Exporting in UWP Pivot Chart (SfPivotChart)

10 May 20212 minutes to read

The SfPivotChart can be exported to an image, Microsoft Word, and PDF file formats. To perform exporting operation, refer to the following assembly in the application:

  • Syncfusion.SfPivotChartConverter.UWP

Export to image

By using the SaveToImageAsync() method, the SfPivotChart can be exported to an image with any of the following image formats:

  • .bmp
  • .gif
  • .png
  • .jpg
  • .jxr
  • .tiff

The following code snippet shows how to export SfPivotChart to an image.

PivotChart1.SaveToImageAsync();
PivotChart1.SaveToImageAsync()

relationalExportedImage

Export to Word document

To export the SfPivotChart contents to Word, include the namespace Syncfusion.UI.Xaml.PivotChartConverter in the code-behind file. Then, create an instance of ExportPivotChartToWord object to access the ExportToDocument method. FileSavePicker can be used to save the exported file in the preferred location.

Refer to the following code snippet to export the SfPivotChart to Word document.

FileSavePicker savePicker = new FileSavePicker();
savePicker.SuggestedFileName = "Sample";
ExportPivotChartToWord export = new ExportPivotChartToWord(this.PivotChart1);
export.ExportToDocument("Sample");
Dim savePicker As New FileSavePicker()
savePicker.SuggestedFileName = "Sample"
Dim export As New ExportPivotChartToWord(Me.PivotChart1)
export.ExportToDocument("Sample")

relationalExportedWord

Export to PDF document

To export the SfPivotChart contents to PDF, include the namespace Syncfusion.UI.Xaml.PivotChartConverter in the code-behind file. Then, create an instance of ExportPivotChartToPdf object to access the ExportToDocument method. The FileSavePicker can be used to save the exported file in the preferred location.

Refer to the following code snippet to export the SfPivotChart to PDF document.

FileSavePicker savePicker = new FileSavePicker();
savePicker.SuggestedFileName = "Sample";
ExportPivotChartToPdf export = new ExportPivotChartToPdf(this.PivotChart1);
export.ExportToDocument("Sample");
Dim savePicker As New FileSavePicker()
savePicker.SuggestedFileName = "Sample"
Dim export As New ExportPivotChartToPdf(Me.PivotChart1)
export.ExportToDocument("Sample")

relationalExportedPDF

NOTE

You can use a Button instance to the page and specify the required code snippet for exporting the SfPivotChart in the Click event handler method.