Edit this page

excelExport

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

Event Data

e.sender kendo.ui.Grid

The widget instance which fired the event.

e.data Array

The array of data items used to create the Excel workbook. Available since version 2014.3.1205.

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 grid will not save the generated file.

Example - subscribe to the "excelExport" event during initialization

<div id="grid"></div>
<script>
$("#grid").kendoGrid({
  toolbar: ["excel"],
  columns: [
    { field: "name" }
  ],
  dataSource: [
    { name: "Jane Doe"},
    { name: "John Doe"}
  ],
  excelExport: function(e) {
    e.workbook.fileName = "Grid.xlsx";
  }
});
var grid = $("#grid").data("kendoGrid");
grid.saveAsExcel();
</script>

Example - subscribe to the "excelExport" event after initialization

<div id="grid"></div>
<script>
$("#grid").kendoGrid({
  toolbar: ["excel"],
  columns: [
    { field: "name" }
  ],
  dataSource: [
    { name: "Jane Doe"},
    { name: "John Doe"}
  ]
});
var grid = $("#grid").data("kendoGrid");
grid.bind("excelExport", function(e) {
    e.workbook.fileName = "Grid.xlsx";
});
grid.saveAsExcel();
</script>