Export to Excel
This method offers exporting functionality and does not require MS Office installation on users' machines. The PivotExcelML format can be read by MS Excel 2002 (MS Office XP) and above.
Figure 1: RadPivotGrid Export to Excel
Exporting Data
Before running export to ExcelML, you have to initialize the PivotExportToExcelML class. The constructor takes one parameter: the RadPivotGrid that will be exported:
Exporting Visual Settings
Using the PivotExcelML method allows you to export the visual settings (themes) to the Excel file. ExcelML has also a visual representation of the alternating column color. The row height is exported with the default DPI transformation (60pixels = 72points). You can enable exporting visual settings through the ExportVisualSettings property. By default the value of this property is true:
Setting the sheet name
You can specify the sheet name through SheetName property. If your data is large enough to be split on more than one sheet, then the export method adds index to the names of the next sheets.
RunExport method
Exporting data to Excel is done through the RunExport method of PivotExportToExcelML object. The RunExport method accepts a string parameter with a valid file path. Consider the code sample below:
Events
ExcelCellFormating event: It gives an access to a single cell’s SingleStyleElement that allows you to make additional formatting (adding border, setting alignment, text font, colors, changing cell value, etc.) for every excel cell related to the exported RadPivotGrid: