Export to Excel and PDF

Hi,

i have been trying out different exports. I have read the documentation and tried the export for PDF and Excel. While the PDF export from the script library works as expected, the Excel export does not seem to work. The exemplary export only exports PDF.

var paperSettings = dundas.print.PaperSettings.fromPaperSize(“A5”);

// Set the PaperSettings orientation property,
// https://www.dundas.com/support/api-docs/js/#API%20Reference/dundas/print/PaperSettings/Properties/orientation.html
paperSettings.orientation = “Landscape”;

// Create the PDF Options
// https://www.dundas.com/support/api-docs/js/#API%20Reference/dundas/export/ExportHelper/Methods/exportPDF.html
var pdfOptions =
{
appendDateToFileName: false,
overrideFileName: false,
openOnCompletion: true,
enableOverlay: false,
paperSettings: paperSettings
};

// Export the PDF with the PDF options.
// https://www.dundas.com/support/api-docs/js/#API%20Reference/dundas/export/ExportHelper/Methods/exportPDF.html
dundas.export.ExportHelper.exportPDF(pdfOptions);
var excelOptions =
{
appendDateToFileName: false,
overrideFileName: false,
openOnCompletion: true,
enableOverlay: false,
selection: dundas.export.ExportSelection.ALL_VISIBLE,
excludeStyles: isLegacyExportCheckbox.control.value
};
// Export the Excel with the Excel options.
// https://www.dundas.com/support/api-docs/js/#API%20Reference/dundas/export/ExportHelper/Methods/exportExcel.html
dundas.export.ExportHelper.exportExcel(excelOptions);

Thank you in advance
Sebastian Soller

Can you explain more about ‘does not seem to work’? It is difficult to guess what is going on without more details.

Hi Sebastian,

I see your code for export to excel has excludeStyles: isLegacyExportCheckbox.control.value. Can you please make sure if you have a control mainly like a radio button named “isLegacyExportCheckbox” that has a value of either true or false?

Thanks,
Pankaj

1 Like

Thank you, removing the excludeStyles: isLegacyExportCheckbox.control.value parameter fixed it for me.