Excel export with caption before exported data

我只是一个虾纸丫 提交于 2019-12-11 03:40:46

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!