I have a grid defined as:-
When I try to export the grid to Excel, a javascript error in kendo.all.min.js of 'Unhandled exception at line 578, column 7 in Function code0x800a138f - JavaScript runtime error: Object expected' is thrown.
If I remove the aggregate expressions, the export runs without a problem. I see the demo example uses aggregates, but can't see any obvious differences.
@(Html.Kendo().Grid<WT_Portal_PMS2.Models.ClockStopsSummary>()
.Name(
"StopGrid"
)
.Columns(col =>
{
col.Bound(o => o.CurrentWaitingBand).Title(
"Weeks Waited"
).ClientFooterTemplate(
"Total"
);
col.Bound(o => o.DNA).Title(
"DNA"
).ClientFooterTemplate(
"#= sum #"
); ;
col.Bound(o => o.IP).Title(
"Admitted"
).ClientFooterTemplate(
"#= sum #"
); ;
col.Bound(o => o.OP).Title(
"Non-Admitted"
).ClientFooterTemplate(
"#= sum #"
); ;
})
.ToolBar(tools => tools.Excel())
.Excel(excel => excel
.FileName(
"ClockStopsSummary.xlsx"
)
.Filterable(
true
)
.AllPages(
true
)
.ProxyURL(Url.Action(
"Excel_Export_Save"
,
"IPWLDQ"
))
)
.DataSource(ds => ds
.Ajax()
.Aggregates(ag =>
{
ag.Add(p => p.DNA).Sum();
ag.Add(p => p.IP).Sum();
ag.Add(p => p.OP).Sum();
})
.PageSize(25)
.Model(m => m.Id(p => p.CurrentWaitingBand))
.Read(rd => rd.Action(
"_Table"
,
"StopsAnalysis"
)
.Data(
"specFilter"
)
)
)
.Sortable()
)
When I try to export the grid to Excel, a javascript error in kendo.all.min.js of 'Unhandled exception at line 578, column 7 in Function code0x800a138f - JavaScript runtime error: Object expected' is thrown.
If I remove the aggregate expressions, the export runs without a problem. I see the demo example uses aggregates, but can't see any obvious differences.