Edit this page

excelExport

Fired when the user clicks the "Export to Excel" toolbar button.

Event Data

e.sender kendo.ui.Spreadsheet

The widget instance which fired the event.

e.data Array

The array of data items used to create the Excel workbook.

e.workbook kendo.ooxml.Workbook

The Excel workbook configuration object. Used to initialize a kendo.ooxml.Workbook class. Modifications of the workbook will reflect in the output Excel document.

e.preventDefault Function

If invoked the spreadsheet will not save the generated file.

Example - subscribe to the "excelExport" event during initialization

<div id="spreadsheet"></div>
<script>
    $("#spreadsheet").kendoSpreadsheet({
        sheets: [{
            name: "Food Order",
            mergedCells: [
                "A1:G1"
            ],
            rows: [{
                height: 70,
                cells: [{
                    value: "My Company", fontSize: 32, textAlign: "center"
                }]
            }],
        }],
        excelExport: function(e) {
        e.workbook.fileName = "Spreadsheet1.xlsx";
        }
    });

    var spreadsheet = $("#spreadsheet").data("kendoSpreadsheet");
    spreadsheet.saveAsExcel();
</script>

Example - subscribe to the "excelExport" event after initialization

<div id="spreadsheet"></div>
<script>
    $("#spreadsheet").kendoSpreadsheet({
        sheets: [{
            name: "Food Order",
            mergedCells: [
                "A1:G1"
            ],
            rows: [{
                height: 70,
                cells: [{
                    value: "My Company", fontSize: 32, textAlign: "center"
                }]
            }],
        }]
    });

    var spreadsheet = $("#spreadsheet").data("kendoSpreadsheet");
    spreadsheet.bind("excelExport", function(e) {
        e.workbook.fileName = "Spreadsheet1.xlsx";
    });

    spreadsheet.saveAsExcel();
</script>
Is this article helpful? Yes / No
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article

close
Dummy