Export table and chart into the same document using toolbar

18 Nov 20181 minute to read

By default, when the e-displayOption.view property is set to Both in the Pivot Table, the export functionality exports either the table or the chart to the PDF document based on the current value of the e-displayOption.primary property. However, to export both the table and the chart into the same PDF document simultaneously, use the pdfExport method during the actionBegin event.

This approach is particularly useful when users need comprehensive reports that include both tabular data and visual representations in a single document.

Implementation steps

Follow these steps to enable combined table and chart export:

  1. Configure the Pivot Table with both table and chart display options.
  2. Handle the actionBegin event to intercept the default export action.
  3. Call the pdfExport method with the exportBothTableAndChart parameter set to true.

Code example

The following example demonstrates how to restrict the built-in export action by setting the args.cancel option to true in the actionBegin event, and then export both the table and the chart by calling the pdfExport method with the exportBothTableAndChart argument set to true.