New to Telerik UI for ASP.NET MVC? Download free 30-day trial

Excel Export

The PivotGrid enables you to export its content to Excel.

By default, the Excel export is enabled when kendo.ooxml.min.js is loaded on the page. kendo.ooxml.min.js is included in kendo.all.min.js and kendo.web.min.js.

To initiate Excel export by using code, call the saveAsExcel method.

For more information, refer to the following resources:

Exporting the Content

By default, the PivotGrid exports the current data with the applied sorting and filtering functionalities. The PivotGrid does not export the current CSS theme in the Excel file. For more information on changing the visual appearance of the Excel document, refer to the following section on customization.

The dataCellTemplate, columnHeaderTemplate, and the rowHeaderTemplate options are not used during the export to Excel. For more information, refer to the following section on templates.

Customizing the Appearance

ExcelExport() allows the customization of the generated Excel document. The workbook event argument exposes the generated Excel workbook configuration. For more information on how the Excel documents work, refer to the article on Excel export in Kendo UI for jQuery.

To apply customizations during the export to Excel:

  1. Attach an Excel export handler.

            .Events(e => e.ExcelExport("excelExport"))
        <kendo-pivotgrid name="configurator"
  2. In the handler, manipulate the generated workbook. The example alternates the background color of the rows cells.

        function excelExport(e) {
            var sheet = e.workbook.sheets[0];
            for (var rowIndex = 1; rowIndex < sheet.rows.length; rowIndex++) {
                if (rowIndex % 2 == 0) {
                    var row = sheet.rows[rowIndex];
                    for (var cellIndex = 0; cellIndex < row.cells.length; cellIndex++) {
                        row.cells[cellIndex].background = "#aabbcc";

Using Templates

The PivotGrid does not use dataCellTemplate, columnHeaderTemplate, and rowHeaderTemplate during Excel export and exports only its data because the templates may contain arbitrary HTML which cannot be converted to Excel column values.

See Also

In this article