111
Views
5
Comments
create excel with dynamic fields

Hello! I would like to know if there is any way to dynamically download a series of data in excel. That is, now I have to associate the download to a fixed structure, but I want to be able to use a more global function (I need to launch the download in Excel in many types of lists). it's possible?

2022-08-03 04-32-50
Ravi Punjwani

Hi Cris,

You can do that with just using the default feature for having a Record List to Excel in any server action.


For a more professional and customizable approach for creatin Excel files, I recommend using the forge component Advanced Excel. The server actions Cell_WriteRange or Cell_WriteRangeWithFormat would be useful for your use case

UserImage.jpg
CrisSanz

Yes, but that functionality is associated with a data structure, which is the problem I'm having, I don't know if I'm going to have one column or 12 or what type they're going to be (int, string, boolean)

2022-08-03 04-32-50
Ravi Punjwani

The suggestions I presented above, won't require you to have a specific number of columns, or types of values in the columns.

Both options are dynamic in terms of number of columns (which is why I suggested).

Can you suggest how it doesn't work for any x number of columns? Please share a sample app OML file if possible (surely you remove any sensitive data, or use a personal environment to create the oml).

Cheers!

UserImage.jpg
CrisSanz


If I use the traditional way, it will always ask me for a structure.

It's true that I can use advance excel, but I can't if I have to pass an object type to a server action from a client action (and therefore use methods like writerange).

2022-08-03 04-32-50
Ravi Punjwani

Hi Cris Sanz,

I didn't quite understand the problem you mentioned for not being able to use the Advanced Excel > Cell Write Range. Did you mean to generate the Excel File purely from a client action, without needing any server interaction?

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.