Exporting in UWP Pivot Chart
18 Nov 20182 minutes to read
The UWP Pivot Chart 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 UWP Pivot Chart 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 UWP Pivot Chart to an image.
PivotChart1.SaveToImageAsync();PivotChart1.SaveToImageAsync()
Export to Word document
To export the UWP Pivot Chart 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 UWP Pivot Chart 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")
Export to PDF document
To export the UWP Pivot Chart 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 UWP Pivot Chart 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")
You can use a Button instance to the page and specify the required code snippet for exporting the UWP Pivot Chart in the
Clickevent handler method.