问题
I was wondering if it's possible to include text above the exported data in an Excel file using Kendo UI?
For example, I wish to include a description of the data above the actual data exported:
Data selected using dates between 1 Jan 2011 to 1 Sep 2011
回答1:
You could attach a handler to the excelExport event of the Grid and manually prepend the row to the exported workbook. The approach won't work if the exported file is filterable.
excelExport: function(e) {
e.workbook.sheets[0].rows.unshift({
cells: [{
value: "Data selected using dates between 1 Jan 2011 to 1 Sep 2011"
}]
});
}
来源:https://stackoverflow.com/questions/30422006/excel-export-with-caption-before-exported-data