how to make a timer that outputs data to Excel

Hello,
I want to make a simple timer that outputs data to Excel from table data of database.
I am using personal environment.

I think I could use "RecordListToExcel", but I do not know where exactly the excel file is output to on the server and not know how I can confirm it.
Is the usage wrong?



Hello Keiya,

The ListToExcel will just create an Excel binary, that becomes available to you to do whatever you want with it. It does not save anything to the server. It is in memory. See more here: https://success.outsystems.com/Documentation/Development_FAQs/How_to_export_entity_data_to_Excel

To save to the server (something I think you can do ONLY on OnPremisses installations, as you don't have access to the server on the cloud (OutSystems infrastructure), you need to use something like the FileSystem extension.

https://www.outsystems.com/forge/component-overview/68/filesystem

What is your use case? 

Cheers.

Thanks Eduardo

I understood about ListToExcel.

And I use outsystems cloud environment. 

So as you say, since I do not use OnPremiss environment, there is no way to save files on the server (even if using FileSystem extension), right?

Solution

Hi Keiya,

There may be some Folders that you could write it to, but there's no way to retrieve them. So you either must store the Excels in the database (and have a download page to retrieve them), or mail them (if they're not too big), or store them in the cloud (e.g. Dropbox, OneDrive, Google Drive etc.).

Solution

Hello Keiya,

@Kilian pretty much gave you the available options.

Personally, wouldn't do this using a timer with a fixed schedule, if the objective is for a user to retrieve the data when the time suits him/her. In that case, for small files, I would just go for a download page that does this.

If there is the need to process the data and/or the file is too big, then a timer not scheduled, that is executed with a Wake action when the user wants the file and then use one of the approaches provided by Kilian.

Cheers.

I agree with Eduardo. Recently I worked on a development where user the import an excel file and the data should be validated and sent to other system using a REST service. If the file is small, on my case was less than 1000 rows, data were imported on the page, if not we wake a timer to process the file. I had to add an action to excel package to count document rows.

We also export to an excel file, but the REST service doesn't provide a method to get the number of rows of the request we need, so we had to always wake the timer.

keiya kawai wrote:

Thanks Eduardo

I understood about ListToExcel.

And I use outsystems cloud environment. 

So as you say, since I do not use OnPremiss environment, there is no way to save files on the server (even if using FileSystem extension), right?


Yes you can use the FileSystem extension to save the file locally on the server even with the cloud environment as long as you write to a folder that you have permission to (components like the html2pdfconverter do exactly this). However it is not a good idea to do this as it can break your system if you ever use multiple front end servers as you will end up with a situation where the file is saved on one server but not the other and then when the user goes to pick it up they have a 50/50 chance of hitting the wrong server. 

If you need to pre generate the file then you should store it in an entity (if it is small) or on a shared network resource if it is large. The latter can be done using the FileSystem extension and pointing the location to a network resource as long as there is a path to it from the Cloud server. We tested this writing from the Cloud servers back to a local network server via a VPN which was rather slow though, other possibilities are an azure or aws file share. Other option is to use one of the Azure or AWS connectors.