Export Excel exceeds maxJson limit

4 posts, 0 answers
  1. John
    John avatar
    16 posts
    Member since:
    Jul 2016

    Posted 12 Sep 2016 Link to this post


    I have a grid which displays fine, but when trying to export to excel it exceeds the maxJson limit.  Why can the grid work, but not the export to excel?  Pageable and PageSize(100) on the grid so I'm guessing that the grid brings back data in chunks, but when it tries to export to excel and AllPages(true) that is where the problem is?



  2. Kostadin
    Kostadin avatar
    1733 posts

    Posted 14 Sep 2016 Link to this post

    Hello John,

    A possible solution is to increase the maxJsonLength in your web.config file or use server exporting. You can check out the following how to article which elaborates more on server exporting.

    Telerik by Progress
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. John
    John avatar
    16 posts
    Member since:
    Jul 2016

    Posted 14 Sep 2016 in reply to Kostadin Link to this post

    Hi Kostadin,

    I tried various things like the web.config file but no luck. However,

    was able to resolve the issue by overriding the Json method as shown below: 

    protected override JsonResult Json(object data, string contentType, System.Text.Encoding contentEncoding, JsonRequestBehavior behavior)
    return new JsonResult()
    Data = data,
    ContentType = contentType,
    ContentEncoding = contentEncoding,
    JsonRequestBehavior = behavior,
    MaxJsonLength = Int32.MaxValue


  4. Ricardo
    Ricardo avatar
    1 posts
    Member since:
    May 2020

    Posted 03 Feb Link to this post

    Excelent. Works good
Back to Top