回复 3楼zhoujinmin的帖子
仅有图片无法确定Demo里哪里出错了。
我使用wijmo.wijgrid自己创建了页面进行测试。
将数据导出到excel文件的页面如下:
http://wijmo.com/docs/wijmo/livewidgets/GridExcelExport.html
在页面上,单击Export to Excel按钮,可以导出excel文件。
打开导出的excel文件,列头等信息正常导出。没有重现该问题。
请参考我的导出excel的html页面。测试代码:
- <script id="scriptInit" type="text/javascript">
- require(["wijmo.wijgrid", "gridexport"], function () {
- $(document).ready(function () {
- $("#wijgrid").wijgrid({
- cellClicked: function (e, args) {
- alert(args.cell.value());
- },
- allowSorting: true,
- data: [
- [27, 'Canada', 'Adams, Craig', 'RW'],
- [43, 'Canada', 'Boucher, Philippe', 'D', 'R'],
- [24, 'Canada', 'Cooke, Matt', 'LW', 'L'],
- [87, 'Canada', 'Crosby, Sidney (C)', 'C', 'L'],
- [1, 'United States', 'Curry, John', 'G', 'L'],
- ],
- columns: [
- {headerText: "Number"},
- {headerText: "Country"},
- {headerText: "Player"},
- {headerText: "Position"}
- ]
- });
- });
- $("#exportXLS").button().click(function () {
- var type = $("#exporttype").val();
- wijmo.exporter.exportGrid({
- serviceUrl: "http://demos.componentone.com/ASPNET/ExportService/exportapi/grid",
- grid: $("#wijgrid").data("wijmo-wijgrid"),
- fileName: "MyGridExport",
- exportFileType: wijmo.exporter.ExportFileType[type],
- excel: {
- author: "Ninja Code Monkey",
- autoRowHeight: true
- }
- });
- });
- });
- </script>
复制代码 |