Edit this page

Exporting

As of the Kendo UI 2015 Q1 release and later, the PivotGrid provides a built-in PDF and Excel export functionality.

PDF Export

PDF export is enabled by default when kendo.all.min.js, kendo.web.min.js, or a custom build that includes PDF scripts are loaded on the page. To set up PDF export, refer to the PDF configuration option.

Important

Exporting in older browsers, such as Internet Explorer 9 or Safari, requires the implementation of a server proxy. For more information, refer to the proxyUrl configuration sections.

Excel Export

Setup

The Excel export is enabled by default when kendo.ooxml.min.js is loaded on the page. Note that kendo.ooxml.min.js is included in kendo.all.min.js and kendo.web.min.js. To set up the export to Excel, refer to the following configuration knowledge sources:

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

Features

Exported Content

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

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

Excel Customization

The excelExport event allows the customization of the generated Excel document. The workbook event argument exposes the generated Excel workbook configuration. For a better understanding about how Excel documents work, refer to the introductory topic on Excel.

Templates

The PivotGrid does not use dataCellTemplate, columnHeaderTemplate, and rowHeaderTemplate during Excel export. It exports only the data. The reason for this is that the templates may contain arbitrary HTML which cannot be converted to Excel column values.

Troubleshooting

"JSZip Is Not Found" JavaScript Error Is Thrown

If the JSZip JavaScript library is not found, an exception is thrown when you click the Export to Excel button or call saveAsExcel. To work around this issue, include JSZip in the page. For more information, refer to the introductory topic on exporting to Excel.

Export Is Not Working in Internet Explorer and Safari

Internet Explorer 10 or older versions and Safari do not support the option of file saving. These browsers require the implementation of a server proxy. To specify the URL of the server proxy, set the proxyURL option.

Example
<div id="grid"></div>
<script>
    $("#grid").kendoGrid({
        toolbar: ["excel"],
        excel: {
            fileName: "Kendo UI Grid Export.xlsx",
            proxyURL: "/proxy"
        },
        dataSource: {
            type: "odata",
            transport: {
                read: "https://demos.telerik.com/kendo-ui/service/Northwind.svc/Products"
            },
            pageSize: 7
        },
        sortable: true,
        pageable: true,
        columns: [
            { width: 300, field: "ProductName", title: "Product Name" },
            { field: "UnitsOnOrder", title: "Units On Order" },
            { field: "UnitsInStock", title: "Units In Stock" }
        ]
    });
</script>

Further Reading

See Also

Other articles on the Kendo UI PivotGrid:

For how-to examples on the Kendo UI PivotGrid widget, browse its How To documentation folder.

Is this article helpful? Yes / No
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article

close
Dummy