Download File
Question

One download button in my application. Based on search criteria I want to download the searched data in CSV format. 

I cant find any standard solution for this.

Champion
Solution

Dear Avijit 

You can download the Data in TXT File. Please find the attached OML for the reference. It is developed using the API: https://success.outsystems.com/Documentation/11/Reference/OutSystems_APIs/BinaryData_API


What AJ has suggested is also right but not a correct approach. In the suggested approach you are downloading the EXCEL File with (.CSV) extension then its a WIN OS feature to open that file in CSV. Even in the WIN OS if you will change the Extension of any XLS file to CSV it will open as CSV. So, it is something like that. 


Without using any Plugin, I have no idea if you can download the CSV but the TXT is possible with the Binary Data API.


Please look into the OML. 

DownloadEntityDatav1.oml

Champion

Hi Avijit 

Any update on the above approach! Have you tried this or even will it help you to achieve you were looking for? 

Hi Manish,


You solution works as expected, I am able to create text file form the database.

Your solution is a good example of the usage of Binary to text API, for each loop and download text file operation. 


Thanks,

Hi Avijit,

check this component, it should solve what you need

https://www.outsystems.com/forge/component-overview/8605/reactive-export-as-excel

I cant use the forge component due to security restrictions.

Please let me know if there is any native solution.

Can this do it?

Try it, please :)

Regards,

Márcio C.

csvsolution.oml

The native action to Export to Excel doesn't convert to csv.

Hello @AVIJIT SARKAR,

Attached demo uses the RecordListToExcel widget as that is your only choice if Forge components are not an option.

There is a catch. You have to force the document to be named with a .csv extension.

You end up getting a notification as shown below:

Click 'Yes' and proceed. The file opens as a csv. If this is acceptable, then this may be your only way out (in Reactive web apps) currently.

Regards,

AJ

SearchResultsDownload.oml

Yes, I did put the solution, and you just need to change the type of file

Hi 

I have done the implementation, it is downloading the file but the format is binary format, not in raw .txt or .csv format.

Is is possible to force download to .csv/.txt

Thanks,

Hello @AVIJIT SARKAR,

if you follow what I had suggested, you should be getting a csv file as the final output.

- AJ

Champion
Solution

Dear Avijit 

You can download the Data in TXT File. Please find the attached OML for the reference. It is developed using the API: https://success.outsystems.com/Documentation/11/Reference/OutSystems_APIs/BinaryData_API


What AJ has suggested is also right but not a correct approach. In the suggested approach you are downloading the EXCEL File with (.CSV) extension then its a WIN OS feature to open that file in CSV. Even in the WIN OS if you will change the Extension of any XLS file to CSV it will open as CSV. So, it is something like that. 


Without using any Plugin, I have no idea if you can download the CSV but the TXT is possible with the Binary Data API.


Please look into the OML. 

DownloadEntityDatav1.oml

Champion

Hi Avijit 

Any update on the above approach! Have you tried this or even will it help you to achieve you were looking for? 

Hi Manish,


You solution works as expected, I am able to create text file form the database.

Your solution is a good example of the usage of Binary to text API, for each loop and download text file operation. 


Thanks,

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