How to use entity record value as excel column header
Question

Hello All, 

I want to add my entity values as excel columns and then want to export that excel in OutSystems. Please refer below example:

Entity Name: Codes

Values: Code1, Code2, Code3

Now I want my excel like this:

Column1: ID 

Column2: Code1 

Column3: Code2 

Column4 : Code3

Please suggest how I can achieve this ?

Note: I do not want to use Advance Excel component provided  by Forge.


Thanks in advance.

mvp_badge
MVP

Hi,

Just create the excel as you describe, without the Id column. Fill the rows with data. Exit excel. Drag and drop the excel file on the data tsb in service studio and press the green button. That's it. An entity will be created a timer that loads the excel will be executed on publish.

If the entity already exist you can use the procedure outlined here

https://success.outsystems.com/Documentation/11/Developing_an_Application/Use_Data/Bootstrap_an_Entity_Using_an_Excel_File

Regards,

Daniel

Hello Daniel,

Thank you for comment.

My goal is not to create the entity by using excel but I want to generate excel with dynamic columns (from my entity data).

Sorry if I confused you. 


mvp_badge
MVP


If columns need to be dynamically set based on data in your entity  there is no build in function in OutSystems and the Advance Excel component provided  by Forge is the best way to solve your problem. Why don't you want to use it?

Ps I edited the title of your question to be more accurate on what you ask.
mvp_badge
MVP

Hi Neeraj,

I agree with Daniel's suggestion for using the Advance Excel component for implementing this use case. Still, if you are not willing to use the forge component, I suggest you refer to any JS library for the implementation.

I have created a sample implementation for your use case, using custom Javascript + dynamically creating XML and exporting the output as .xls file.

I'm not sure, the solution is efficient or not, but I think this is an alternative solution.

See this sample screen GenerateExcelDemo

Refer to the attached .oml file. 


I hope this helps you!


Kind regards,

Benjith Sam


RWALabGenerateXL.oml

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