Page 1 of 1

it2be_data excel export in ngclient

PostPosted: Tue Feb 04, 2020 1:02 pm
by marco.rossi
Hi all,
I have this simple function to export a dataset in excel which is properly working on SmartClient but not on NGClient.

Code: Select all
function exportToExcel(dataSet, headers){

   var file = plugins.file.createTempFile("export",".xls");   
   var fileName = file.getAbsoluteFile();
   var excelDoc = plugins.it2be_data.createExcel();
   excelDoc.convertDataSet(dataSet);
        excelDoc.write(fileName.getAbsolutePath(), headers, dataSet)
}


By going on the plugin page (https://servoycomponents.com/components ... ata-plugin), I see it's marked as compatible with NGClient.
This is the api page where it's specifically marked as NGClient compatible as well: http://software.servoycomponents.com/do ... tion_write

Unfortunately the examples here are outdated (the function plugins.it2be_data.excel().write(filePath.getAbsolutePath(), dataset) is not used anymore).

I know how to export a dataset without using this plugin but this would mean to put hundreds of forms in QA.
Does anyone know how to make this plugin working on NGClient??

Thank you for your time

Marco

Re: it2be_data excel export in ngclient

PostPosted: Tue Feb 04, 2020 4:52 pm
by sean
Hi Marco,

That is a 3rd-party plugin, so you may want to contact the vendor directly.
Did you get any errors? If so, paste them here.

Also keep in mind that an working with files in NGClient is different than SmartClient as all paths will be relative to the server's file system.

Re: it2be_data excel export in ngclient

PostPosted: Tue Feb 04, 2020 5:13 pm
by swingman
Hi Marco,

The NG-Client does not have access to the file system, so
Code: Select all
excelDoc.write(fileName.getAbsolutePath(), headers, dataSet)


does not make sense. Try putting in a simple filename instead.

Code: Select all
excelDoc.write(fileName, headers, dataSet)


or

Code: Select all
excelDoc.write("test.xlxs", headers, dataSet)



If successful you will end up with a download in your Downloads directory or wherever your browser saves downloaded files.

Christian