0

I have a Kendo Grid with wrapper for ASP.NET MVC. It returns even 30,000 rows when the database is in my laptop. However, when the database is in a remote system, it works only for 15,000 rows. Beyond that Fiddler Get response shows a empty JSON set. Is there some bottleneck in JSON data over networks ?

This is the code in my controller class :

public JsonResult Get([DataSourceRequest]DataSourceRequest request)
        {

            myStartDate = (DateTime)Session["myStartDate"];
            myEndDate = (DateTime)Session["myEndDate"];

            // SP query to select products and map to model objects
            var products = ConvertOutputOfAdminAssociateSPToAList(myStartDate,myEndDate);

            Session["ProductionList"] = products;

            // convert to a DataSourceResponse and send back as JSON
            return this.Json(products.ToDataSourceResult(request));
        }

Here is the view

@(Html.Kendo().Grid<Production>().Name("Production").Columns(c => {

    c.Bound(p => p.DateProcessed).Title("Processed").Format("{0:MM-dd-yyyy}").ClientFooterTemplate("Total Count: #=count#")
            .ClientGroupFooterTemplate("Count: #=count#");
    c.Bound(p => p.ReceiptDate).Title("Received").Format("{0:MM-dd-yyyy}");
    c.Bound(p => p.ClaimNo);
    c.Bound(p => p.Associate);
    c.Bound(p => p.ProcessLevel).Title("Level");
    c.Bound(p => p.NoOfLines).Title("Lines").ClientFooterTemplate("Sum: #=sum#")
                .ClientGroupFooterTemplate("Sum: #=sum#").ClientFooterTemplate("Average: #= kendo.toString(average,'0.00') #")
                .ClientGroupFooterTemplate("Average: #= kendo.toString(average,'0.00') #");
    c.Bound(p => p.Auditor);
    c.Bound(p => p.Manufacturer);
    c.Bound(p => p.ClaimantName).Title("Claimant");
    c.Bound(p => p.ClaimStatus).Title("Status");
    c.Bound(p => p.FTR);
    c.Bound(p => p.Remarks);
    c.Bound(p => p.RequestedAmount).Title("Amount").Format("{0:n2}") .ClientFooterTemplate("Sum: #=sum#")
                .ClientGroupFooterTemplate("Sum: #=sum#");
    c.Bound(p => p.Error);
    })
    .DataSource(d => d
        .Ajax()
        .Read(r => r.Action("Get", "Production"))
        .PageSize(8)
        .Aggregates(aggregates =>
                                                  {
                                                      aggregates.Add(p => p.DateProcessed).Count();
                                                      aggregates.Add(p => p.NoOfLines).Sum();
                                                      aggregates.Add(p => p.NoOfLines).Average();
                                                      aggregates.Add(p => p.RequestedAmount).Sum();

                                                  })
    )
    .ToolBar(toolBar => 
                    toolBar.Custom()
                        .Text("Export To CSV")
                        .HtmlAttributes(new { id = "export" })
                        .Url(Url.Action("Export", "Production", new { page = 1, pageSize = "~", filter = "~", sort = "~" }))
    )
    .Events(ev => ev.DataBound("onDataBound"))
    .Pageable()
    .Groupable()
    .Sortable()
    .Filterable()

)
Chakra
  • 2,525
  • 8
  • 43
  • 82
  • Check config for maxRequestimeout, it might be giving up connection till data get. – Arindam Nayak Nov 25 '14 at 17:09
  • @ArindamNayak I could not find any setting like that. SSRS report works on the same database and delivers large data. – Chakra Nov 25 '14 at 17:13
  • Check this - http://stackoverflow.com/questions/10649843/how-to-give-maximum-executiontimeout-to-the-application, it is `maxexecutiontimeout` - it is specific to web application where json thing happens – Arindam Nayak Nov 25 '14 at 17:17
  • This helped me http://stackoverflow.com/questions/10966328/getting-the-json-request-was-too-large-to-be-deserialized – Chakra Dec 01 '14 at 04:56

1 Answers1

1

I never needed to adjust any jsonSerialization config settings..

To your

@(Html.Kendo().Grid<Production>() 

add...

.Scrollable(scrollable => scrollable.Virtual(true))

You can use that with paging, etc...thus

@(Html.Kendo().Grid<Production>()
    .Name("Production")
    .Scrollable(scrollable => scrollable.Virtual(true))
    .Columns(c => {

c.Bound(p => p.DateProcessed).Title("Processed").Format("{0:MM-dd-yyyy}").ClientFooterTemplate("Total Count: #=count#")
        .ClientGroupFooterTemplate("Count: #=count#");
c.Bound(p => p.ReceiptDate).Title("Received").Format("{0:MM-dd-yyyy}");
c.Bound(p => p.ClaimNo);
c.Bound(p => p.Associate);
c.Bound(p => p.ProcessLevel).Title("Level");
c.Bound(p => p.NoOfLines).Title("Lines").ClientFooterTemplate("Sum: #=sum#")
            .ClientGroupFooterTemplate("Sum: #=sum#").ClientFooterTemplate("Average: #= kendo.toString(average,'0.00') #")
            .ClientGroupFooterTemplate("Average: #= kendo.toString(average,'0.00') #");
c.Bound(p => p.Auditor);
c.Bound(p => p.Manufacturer);
c.Bound(p => p.ClaimantName).Title("Claimant");
c.Bound(p => p.ClaimStatus).Title("Status");
c.Bound(p => p.FTR);
c.Bound(p => p.Remarks);
c.Bound(p => p.RequestedAmount).Title("Amount").Format("{0:n2}") .ClientFooterTemplate("Sum: #=sum#")
            .ClientGroupFooterTemplate("Sum: #=sum#");
c.Bound(p => p.Error);
})
.DataSource(d => d
    .Ajax()
    .Read(r => r.Action("Get", "Production"))
    .PageSize(8)
    .Aggregates(aggregates =>
                                              {
                                                  aggregates.Add(p => p.DateProcessed).Count();
                                                  aggregates.Add(p => p.NoOfLines).Sum();
                                                  aggregates.Add(p => p.NoOfLines).Average();
                                                  aggregates.Add(p => p.RequestedAmount).Sum();

                                              })
)
.ToolBar(toolBar => 
                toolBar.Custom()
                    .Text("Export To CSV")
                    .HtmlAttributes(new { id = "export" })
                    .Url(Url.Action("Export", "Production", new { page = 1, pageSize = "~", filter = "~", sort = "~" }))
)
.Events(ev => ev.DataBound("onDataBound"))
.Pageable()
.Groupable()
.Sortable()
.Filterable()

)

Robert Achmann
  • 1,986
  • 3
  • 40
  • 66