Skip to main content


         This documentation site is for previous versions. Visit our new documentation site for current releases.      
 

exportToExcel(exportRequest)

Updated on July 20, 2021

Exports a table into an Excel file.

Returns

A Promise that resolves to a base64 response (the Excel file).

Parameters

NameTypeDescriptionRequired
exportRequestobjectA payload object to configure the export.

The following table contains the properties of the exportRequest object:

NameTypeDescriptionRequired
pyNamestringThe name of the exported table.
pyModestringThe type of export to be performed ("excel", etc.)
pyClassNamestringThe class of the data to be exported.
pyContentstringA stringified JSON object containing the table component metadata and state.

Usage example

In this example, the API returns a Promise that resolves to a base64 response (the Excel file).

const exportRequest = {
  pyName: "Export",
  pyMode: "excel",
  pyClassName: "@baseclass",
  pyContent: JSON.stringify({ metadata, state })
};
PCore.getAnalyticsUtils().exportToExcel(exportRequest).then(response => { ... }).catch(() => { ... });

Have a question? Get answers now.

Visit the Support Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega.com is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us