Articles in this section
Category / Section

Using JSON export to export a lot of data from ASP.NET Web Forms PivotGrid

1 min read

This KB illustrates that to export large amount of data in PivotGrid with JSON export.


By default, you can export data from pivot component up to 12,000 JSON records. Meanwhile, you can increase the limit by setting the following required properties in Web.config file with maximum limit.


        <jsonSerialization maxJsonLength="2147483647"/> 
    <add key="aspnet:MaxJsonDeserializerMembers" value="2147483647" /> 
<httpRuntime maxRequestLength="1073741824" targetFramework="4.5" /> 
      <requestLimits maxAllowedContentLength="1073741824" /> 


This code increases the exporting support up to 200,000 records. But, when exporting with styles, the maximum exporting support will be up to 150,000 records. Disabling the exportWithStyle api in the “beforeExport” event provides an option to export up to 200,000 records for all types of exporting (Word, PDF, Excel). Find the following code snippet to disable the exportWithStyle api.

JS (beforeExport event for all platforms)

<script type="text/javascript">
function exporting (args) {
    args.exportWithStyle = false;   // by default it sets as true. It improves performance on exporting huge data when it sets as false.



<ej:PivotGrid ID="PivotGrid1" runat="server">
   <ClientSideEvents  BeforeExport="exporting"/>



@Html.EJ().Pivot().PivotGrid("PivotGrid1").ClientSideEvents(clientSideEvents => clientSideEvents.BeforeExport("exporting"))



 beforeExport: "exporting"


Did you find this information helpful?
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment