在导出数据之前使用标题导出Excel [英] Excel export with caption before exported data

查看:84
本文介绍了在导出数据之前使用标题导出Excel的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否可以使用Kendo UI在Excel文件中包含导出数据上方的文本?

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:


使用2011年1月1日至2011年9月1日之间的日期选择的数据

Data selected using dates between 1 Jan 2011 to 1 Sep 2011


推荐答案

您可以将处理程序附加到Grid的excelExport事件,并手动将该行预先添加到导出的工作簿中。如果导出的文件是可过滤的,则该方法将不起作用。

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"
    }]
  });
}

这篇关于在导出数据之前使用标题导出Excel的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆