We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to export large amount of data in PivotGrid with JSON export?

Platform: ASP.NET Web Forms |
Control: PivotGrid |
Published Date: September 26, 2018 |
Last Revised Date: July 2, 2019
Tags: asp, js, mvc, pivotgrid

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

Solution

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.

Web.config

<system.web.extensions> 
    <scripting> 
      <webServices> 
        <jsonSerialization maxJsonLength="2147483647"/> 
      </webServices> 
    </scripting> 
  </system.web.extensions> 
  <appSettings> 
    <add key="aspnet:MaxJsonDeserializerMembers" value="2147483647" /> 
//…. 
<httpRuntime maxRequestLength="1073741824" targetFramework="4.5" /> 
<pages> 
//… 
<system.webServer> 
  <security> 
    <requestFiltering> 
      <requestLimits maxAllowedContentLength="1073741824" /> 
    </requestFiltering> 
  </security> 
  </system.webServer>

 

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.
}
</script>

 

ASP

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

 

MVC

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

 

JS

$("#PivotGrid1").ejPivotGrid({
  //..
 beforeExport: "exporting"
});

 

2X faster development

The ultimate ASP.NET Web Forms UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile