I am populating a table with data, and needing to allow a user to click a button and export that data to excel through the download action. I am familiar with this process on Traditional Web apps but not in the new Reactive apps.
Hello Eric,
Create a server action and use the RecordListToExcel, then define an output parameter as binary.
Then just drag that Action to the client action, use the download widget and use the binary output parameter defined on the server action.
Hope it helps,
Cheers!
Tiago Gomes wrote:
Don't you still need an input parameter for the server action to send to the RecordListtoExcel though if your aggregate lives on the screen?
Hi Tiago,
Would you able to share the oml file for above mentioned example? I am having difficulty in exporting the aggregate.
Regards
Arokianathan
Also have the same question!What if we need to pass our RecordListToExcel to the Server Action, when it's a composite aggregate/specific list (i.e., not in the database)???
Thank you. Everything works, except I download an empty file. The Aggregate returns lots of data (I tested), but the downloaded file always cames empty. What am I doing wrong?
Hi Arokia,
The aggregate data is fetched asynchronously, so you need to check if you already have data or not before allow the user to execute your screen Action1. Or you can call that action on the After Fetch event of the aggregate. If you not do this, you cannot have 100% sure that the data was fetched, before the download action is requested.
Documentation:
[1 - After Fetch] https://success.outsystems.com/Documentation/11/Developing_an_Application/Implement_Application_Logic/Screen_and_Block_Lifecycle_Events#on-after-fetch
[2 - Assync Data]
https://success.outsystems.com/Documentation/11/Developing_an_Application/Use_Data/Query_Data/Implement_asynchronous_data_fetching_using_Aggregates
Thanks for sharing