Converting to Excel Without Server Action

Converting to Excel Without Server Action

  

Hi,

I am currently working on a mobile app.

I understand that under server action you can convert entities to excel.

But the current app that I am working on needs to function without any database.

So how do I convert the Local entities into excel on client action and export the excel file to a computer using the USB port?

Thanks!

Hi Jasper,

This is possible with Javascript, but you must turn your data to JSON.

Here is an example.

Regards,

Furkan Çetin

Hi JasperC,

Converting data to Excel file is not possible out of the box in OutSystems from the client (there may be javascript libraries out there in the wild that you can add to do this, I haven't checked).

In order to generate the Excel file on the server side, you don't need a database, you can just pass your local entities to a server action as input parameter and use it directly as the input of the RecordListToExcel tool.

As far as I know there is no way of then passing this binary file via USB though. You may be able to store it on the filesystem for Android apps, but that would be it.

I can see that the local entity shows up under the Application tab of Chrome developer tools and I was able to extract the result thru the following codes

var db = openDatabase('Movies', '', 'Local Ticket', 2 * 1024 * 1024);


db.transaction(function (tx) {
  tx.executeSql('SELECT * FROM OSUSR_Z7O_LOCALTICKET', [], function (tx, results) {
     console.log(results);
    });
});


Not sure though about interoperability of Web SQL in android and ios. I heard that there's certain restriction as the Web SQL API is already deprecated

John Alvin Salamat wrote:

I can see that the local entity shows up under the Application tab of Chrome developer tools and I was able to extract the result thru the following codes

var db = openDatabase('Movies', '', 'Local Ticket', 2 * 1024 * 1024);


db.transaction(function (tx) {
  tx.executeSql('SELECT * FROM OSUSR_Z7O_LOCALTICKET', [], function (tx, results) {
     console.log(results);
    });
});

Why go through all this Javascript work when you can simply use an Aggregate?... But this is a moot point if you don't have some client-side way of converting to Excel.


JasperC wrote:

Hi,

I am currently working on a mobile app.

I understand that under server action you can convert entities to excel.

But the current app that I am working on needs to function without any database.

So how do I convert the Local entities into excel on client action and export the excel file to a computer using the USB port?

Thanks!

Jasper,

Please check this this. https://datatables.net/extensions/buttons/examples/html5/simple.html