// Get the export service. var exportService = this.getService('ExportService'); // Get the view service. var viewService = this.getService('ViewService'); // Get the web app service. var webAppService = this.getService('WebAppService'); // Create the export request. var exportRequest = new dundas.export.ExportRequest( { isLegacyExport: true, // Export Excel providerId: dundas.constants.STANDARD_EXCEL_EXPORT_PROVIDER_ID, viewId: this.parentView.id, viewData: this.getService("CanvasService").canvas.viewModel.businessObject.control }); // Create parameter value to pass to the request. var parameterValue = new dundas.data.CollectionStringValue(); var adapterIdsParameterId = dundas.constants.EXCEL_ADAPTERS_ID; parameterValue.parameterId = adapterIdsParameterId; // Set an array of adapter ids to include debugger; parameterValue.values = [table1.id]; // tableQTMByOfferingExport.id, tableQTMByChannelExport.id, //Get parameter values var includeParameterValues = new dundas.data.SingleBooleanValue(); includeParameterValues.parameterId = dundas.constants.EXCEL_INCLUDE_PARAMETERS_ID; includeParameterValues.value = true; exportRequest.parameterValues.push(includeParameterValues); // Push the parameter value to export request. exportRequest.parameterValues.push(parameterValue); var selectionParameterValue = new dundas.data.SingleNumberValue(); selectionParameterValue.parameterId = dundas.constants.EXCEL_EXPORT_SELECTION_ID; // 3 for multiple values. selectionParameterValue.value = 3; exportRequest.parameterValues.push(selectionParameterValue); // 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); } );