【发布时间】:2016-02-02 17:48:59
【问题描述】:
在尝试将 4000 多条记录导出到 excel 时,Kendo 网格导出到 excel 没有响应......甚至没有抛出错误消息......有人可以请建议或建议解决此问题。
这是剑道网格的代码
@(Html.Kendo().Grid(Model)
.Name("Billinggrid")
.Columns(columns =>
{
columns.Bound(c => c.groupid).Width(75).Filterable(true).Sortable(true).HeaderHtmlAttributes(new { style = "overflow: visible; white-space: normal" });
columns.Bound(c => c.groupname).Width(125).Filterable(true).Sortable(true).HeaderHtmlAttributes(new { style = "overflow: visible; white-space: normal" });
columns.Bound(c => c.groupeffectivedate).Width(90).Filterable(true).Sortable(true).HeaderHtmlAttributes(new { style = "overflow: visible; white-space: normal" });
columns.Bound(c => c.recipientdatareceived).Width(95).Filterable(true).Sortable(true).HeaderHtmlAttributes(new { style = "overflow: visible; white-space: normal" });
columns.Bound(c => c.recipientsent).Width(100).Filterable(true).Sortable(true).HeaderHtmlAttributes(new { style = "overflow: visible; white-space: normal" });
columns.Bound(c => c.accountmanager).Width(125).Filterable(true).Sortable(true).HeaderHtmlAttributes(new { style = "overflow: visible; white-space: normal" });
columns.Bound(c => c.billinggroup).Width(75).Filterable(true).Sortable(true).HeaderHtmlAttributes(new { style = "overflow: visible; white-space: normal" });
columns.Bound(c => c.reportyearmonth).Width(85).Filterable(true).Sortable(true).HeaderHtmlAttributes(new { style = "overflow: visible; white-space: normal" });
columns.Bound(c => c.recordcount).Width(55).Filterable(false).Sortable(true).HeaderHtmlAttributes(new { style = "overflow: visible; white-space: normal" });
columns.Bound(c => c.datafilecount).Width(50).Filterable(false).Sortable(true).HeaderHtmlAttributes(new { style = "overflow: visible; white-space: normal" });
columns.Bound(c => c.datacharge).Format("{0:c}").Filterable(false).Sortable(false).HeaderHtmlAttributes(new { style = "overflow: visible; white-space: normal" });
columns.Bound(c => c.printcharge).Format("{0:c}").Filterable(false).Sortable(false).HeaderHtmlAttributes(new { style = "overflow: visible; white-space: normal" });
columns.Bound(c => c.insertcharge).Format("{0:c}").Filterable(false).Sortable(false).HeaderHtmlAttributes(new { style = "overflow: visible; white-space: normal" });
columns.Bound(c => c.envelopecharge).Format("{0:c}").Filterable(false).Sortable(false).HeaderHtmlAttributes(new { style = "overflow: visible; white-space: normal" });
columns.Bound(c => c.postage).Format("{0:c}").Filterable(false).Sortable(false);
columns.Bound(c => c.total).Format("{0:c}").Filterable(false).Sortable(false);
columns.Bound(c => c.postageremaining).Width(95).Format("{0:c}").Filterable(true).Sortable(true).HeaderHtmlAttributes(new { style = "overflow: visible; white-space: normal" });
})
.Resizable(resizable => resizable.Columns(true))
.Reorderable(reorderable => reorderable.Columns(true))
.Pageable(pager => pager.PageSizes(new int[] { 10, 25, 50, 100, 500 })
.Messages(messages => messages.ItemsPerPage(" items displayed"))
)
.Sortable()
.Scrollable(scr => scr.Height("auto"))
.HtmlAttributes(new { style = "Font-size:x-small" })
//.ToolBar(tools => tools.Excel())
.Excel(excel => excel
.FileName("Billing_Report-" + DateTime.Now + ".xlsx")
.AllPages(true)
//.Filterable(true)
.ProxyURL(Url.Action("Excel_Export_Save", "Report"))
)
//.Filterable(ftb => ftb.Mode(GridFilterMode.Row))
.ToolBar(toolbar =>
【问题讨论】:
-
我遇到了同样的问题。但是我的网格停止从 2000 条记录中导出(但我有大约 40 列)..由于它是通过客户端导出的,我认为这将是一些内存问题......不幸的是我没有解决它......我只是从一些记录中禁用 Telerik 导出按钮。所以我投票赞成,这个问题对我来说也很有趣。
标签: excel telerik-grid