Export in WPF OLAP Grid Control

2 Jun 20213 minutes to read

The OLAP grid data can be exported to Microsoft Excel, Microsoft Word, and PDF file formats. This can be achieved using the following methods of the OLAP grid.

Excel export

// Export OlapGrid Data to Excel

' Export OlapGrid Data to Excel 


Exports OlapGrid into excel document

Word export

// Export OlapGrid Data to Word

' Export OlapGrid Data to Word 


Exports OlapGrid into word document

PDF export

// Export OlapGrid Data to PDF

' Export OlapGrid Data to PDF


Exports OlapGrid into pdf document

The format state of grid is maintained on exported documents.

Sample location

A sample demo is available in the following location.

..\Syncfusion\EssentialStudio<Versionnumber>\BI\WPF\OlapGrid.WPF\Samples\Exporting\Exporting Grid Demo

CSV export

The OLAP grid for WPF supports exporting itself to the CSV file format.


Method Description Parameters Type Return Type
Export(string filename) Gets the file name to save the file with the specified name. filename as string - void
ExportToCsv(PivotEngine pivotEngine, string filename) Gets the pivot engine and file name for exporting the content to a CSV file format with the specified name. pivotEngine as PivotEngine, filename as string - void

Adding CSV export for OLAP grid in an application

The GridCsvExport class supports for exporting data from OLAP grid to a CSV file format. Add the following assembly along with default assemblies in the reference folder:

  • Syncfusion.OlapGridConverter.Wpf
SaveFileDialog saveFileDialog = new SaveFileDialog();

saveFileDialog.AddExtension = true;

saveFileDialog.FileName = "OlapGrid Report";

saveFileDialog.DefaultExt = "CSV";

saveFileDialog.Filter = "Csv file (.csv)|*.csv";

if (saveFileDialog.ShowDialog() == true)


    if (this.olapGrid.InternalGrid != null && this.olapGrid.InternalGrid.Engine != null)


         GridCsvExport gridCsvExport = new GridCsvExport(this.olapGrid.InternalGrid.Engine);


         MessageBox.Show("CSV document exported successfully!");


Dim saveFileDialog As New SaveFileDialog()

saveFileDialog.AddExtension = True

saveFileDialog.FileName = "OlapGrid Report"

saveFileDialog.DefaultExt = "CSV"

saveFileDialog.Filter = "Csv file (.csv)|*.csv"

If saveFileDialog.ShowDialog() = True Then

If Me.olapGrid.InternalGrid IsNot Nothing AndAlso Me.olapGrid.InternalGrid.Engine IsNot Nothing Then

        Dim gridCsvExport As New GridCsvExport(Me.olapGrid.InternalGrid.Engine)


        MessageBox.Show("CSV document exported successfully!")

End If

End If

Exports OlapGrid into CSV document

{Installation Drive}:\Users<user name>\AppData\Local\Syncfusion\EssentialStudio<version number>\BI\WPF\OlapGrid.Wpf\Samples\Exporting\Exporting Demo