Edit this page

Insert Rows When Exporting the Grid to Excel

Environment

Product Grid for Progress Kendo UI
Progress Kendo UI version 2017.2.621

Description

How can I intercept the Excel export of the Kendo UI Grid and add data to the exported file?

Solution

When the excelExport event is fired, access the configuration object of the Excel workbook and add rows to its sheets in the e.workbook property.

       function excelExport(e) {
        console.log(e.workbook.sheets[0].rows)
        e.workbook.sheets[0].rows.unshift(
            {
                cells: [
                    {
                        value: "Some content",
                        background: "#7a7a7a",
                        colSpan: 2,
                        color: "#fff",
                        rowSpan: 2
                    }
                ]
            } )
    }
Is this article helpful? Yes / No
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article

close
Dummy