Hi Pierre,
I’m not sure if this is helpful at all since the export in this example is to xlsx and is a script that is ran on a button click but this is what we use to export to Excel with the set parameters listed on the left hand side. Just be sure to change parameterValue.values = [ ExportTable.id ]; to whatever the script name is of the item you are trying to export.
// Get the export service.
var exportService = this.getService(‘ExportService’);
// Get the view service.
var viewService = this.getService(‘ViewService’);
// Create the export request.
var exportRequest =
new dundas.export.ExportRequest(
{
isLegacyExport: true,
// Export Excel
providerId: dundas.constants.STANDARD_EXCEL_EXPORT_PROVIDER_ID,
viewData: this.getService("CanvasService").canvas.viewModel.businessObject.control
});
// Create parameter value to pass to the request.
var parameterValue = new dundas.data.CollectionStringValue();
parameterValue.parameterId = dundas.constants.EXCEL_ADAPTERS_ID;
parameterValue.values = [ ExportTable.id ];
exportRequest.parameterValues.push(parameterValue);
//Multiple select
var parameterValue = new dundas.data.SingleNumberValue();
parameterValue.parameterId = dundas.constants.EXCEL_EXPORT_SELECTION_ID;
parameterValue.value = 3 ;
exportRequest.parameterValues.push(parameterValue);
//Include parameters
var parameterValue = new dundas.data.SingleBooleanValue;
parameterValue.parameterId = dundas.constants.EXCEL_INCLUDE_PARAMETERS_ID;
parameterValue.value = true;
exportRequest.parameterValues.push(parameterValue);
//On the left
var parameterValue = new dundas.data.SingleNumberValue();
parameterValue.parameterId = dundas.constants.EXCEL_PARAMETER_VALUES_LOCATION_ID;
parameterValue.value = 2;
exportRequest.parameterValues.push(parameterValue);
//Append date to file name
var parameterValue = new dundas.data.SingleBooleanValue;
parameterValue.parameterId = dundas.constants.APPEND_DATE_TO_FILE_NAME_ID;
parameterValue.value = true;
exportRequest.parameterValues.push(parameterValue);
// Get the perform export promise.
var exportPromise =
exportService.performExport(exportRequest);
// Setup a loading dialog.
viewService.showLoadingRestCall(exportPromise);
exportPromise.done(
function(exportId)
{
// Get the Url for the export file.
var exportFileUrl =
exportService.getExportResultUrl(exportId);
// Force the browser to download the file.
window.location.replace(exportFileUrl);
}
);