Excel export with aggregates not working

4 posts, 0 answers
  1. Shuja
    Shuja avatar
    30 posts
    Member since:
    Mar 2011

    Posted 21 Nov 2014 Link to this post

    I have a grid defined as:-
        .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
                                        .ProxyURL(Url.Action("Excel_Export_Save", "IPWLDQ"))
            .DataSource(ds => ds
                    .Aggregates(ag =>
                        ag.Add(p => p.DNA).Sum();
                        ag.Add(p => p.IP).Sum();
                        ag.Add(p => p.OP).Sum();
                            .Model(m => m.Id(p => p.CurrentWaitingBand))
                      .Read(rd => rd.Action("_Table", "StopsAnalysis")

    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. 
  2. Atanas Korchev
    Atanas Korchev avatar
    8462 posts

    Posted 25 Nov 2014 Link to this post


    It is indeed strange as the online demo supports aggregates just fine. Could you open a support ticket and send us a runnable sample which reproduces the JS error? We suspect something in the data is causing the error but cannot be sure until we reproduce it at our side.

    Atanas Korchev

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

  3. Shuja
    Shuja avatar
    30 posts
    Member since:
    Mar 2011

    Posted 25 Nov 2014 in reply to Atanas Korchev Link to this post

    Thanks, I'll see what I can put together.
  4. John
    John avatar
    14 posts
    Member since:
    Jul 2011

    Posted 12 Dec 2014 Link to this post

    I have the same issue, works great for grids w/out an aggregate footer.  I get a javascript runtime error: object expected in the footertemplate area of kendo.all.min for those with aggregate functions.

    I create all most my grids using razor vs the js route if that makes any difference to you.  Maybe something's getting lost in the translation?
Back to Top