it2be_data excel export in ngclient

Hi all,
I have this simple function to export a dataset in excel which is properly working on SmartClient but not on NGClient.

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

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.

Hi Marco,

The NG-Client does not have access to the file system, so

excelDoc.write(fileName.getAbsolutePath(), headers, dataSet)

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

excelDoc.write(fileName, headers, dataSet)

or

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