Skip to content

This example demonstrates how to export ASP.NET MVC Pivot Grid to PDF and XLSX formats, specify various export options and customize the exported cell's content and appearance.

License

Notifications You must be signed in to change notification settings

DevExpress-Examples/mvc-pivot-grid-custom-export

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

How to Export ASP.NET MVC Pivot Grid to PDF and XLSX Formats with Custom Settings

This example demonstrates how to export ASP.NET MVC Pivot Grid to PDF and XLSX formats, specify various export options and customize the exported cell's content and appearance.

The following image shows the MVCXPivotGrid when the example is run.

Click the Export to XLSX (DataAware), Export to XLSX (WYSIWYG) or Export to PDF button to perform export.

Export to XLSX format is performed using the PivotGridExtension.ExportToXlsx method. To specify export options, this example creates the PivotXlsxExportOptions class instance, modifies it as required and passes to the method as a parameter. The PivotXlsxExportOptions type is properly accepted because it inherits the XlsxExportOptions class.

To customize the cell content and appearance individually for each cell, this example handles the PivotXlsxExportOptions.CustomizeCell event.

Default export type is data-aware. The resultant file is shown below.

To set the export type to WYSIWYG, this example uses the PivotGridExtension.ExportToXlsx method with the DevExpress.XtraPrinting.XlsxExportOptionsEx parameter whose ExportType property is set to the DevExpress.Export.ExportType.WYSIWYG value. The resultant file is shown below.

Export to PDF is performed using the PivotGridExtension.ExportToPdf method with the PivotGridSettings instance passed as the method parameter. The PivotGridSettings.SettingsExport.OptionsPrint property is used to specify page settings.

To customize the cell content and appearance individually for each cell, this example handles the PivotGridSettings.SettingsExport.CustomExportCell event.

Does this example address your development requirements/objectives?

(you will be redirected to DevExpress.com to submit your response)

About

This example demonstrates how to export ASP.NET MVC Pivot Grid to PDF and XLSX formats, specify various export options and customize the exported cell's content and appearance.

Topics

Resources

License

Stars

Watchers

Forks