Export data to Excel

Hi!
How can I export information from a stored procedure to excel?
and how can I export more than 256 columns?

Please take a look on CUBA Reporting module, it provides a convenient way to export data to Excel, please check docs here.

It’s ok, but i need something like this

EntityManager em = persistence.getEntityManager();
List result = em.createNativeQuery(“call sp_my_stored_procedure(”+idA+","+idB+","+idC+","+idD+")",MyClass.class).getResultList();

And transform the result to excel.

Thanks!

Is your aim to create a file on a middle tier? In such case you’d better use Apache POI directly, it’s been already contained in CUBA. If you were to display the result to a user firstly I’d recommend you to check excel table action. You can implement a custom procedure-based datasource and use it with a table with an excel action.