How to make Excel Export header visible even when data is not entered

0
I am using the XLS Report module for exporting Mendix data to Excel. My Mendix version is 10.12.4. I have a download button that allows for a user to download the data into an excel sheet. When there is data, the headers show up and everything works perfectly; however, when there is no data, the headers (column 0) are not visible. In summary, the headers are only visible when at least one row is filled with exported data. The goal is to let the user receive a fresh template (with headers) to fill out and upload data back into the app, but that cannot be done if the headers are not known. Is there a solution to be able to download the excel sheet and have the headers even if no data is entered?
asked
1 answers
1

Hi Jah,

I think this is the default behaviour of export to excel when we have some data then it exports data with headers otherwise headers will be empty.

 

Logic:-

In the microflow check your retrieval list is empty or not in the decision 

if list is not empty then follow export to excel logic but if list is empty then create one object and assign the value like this string(empty), int/dec(0),boolean(false) etc. then write export to excel logic for this object.

After exporting the data use delete object activity and delete this object.

By using this logic you have one row data with null/unused value now you will be able to see the headers after that delete the object.

 

Hope you like the answer.

answered