Export to excel

Hi
I have a problem when I try to export a PivotClient to excel.
-------------------------------------------------------------------------------------------------------------------------------------------
 public void ExportPivotClient()
        {
            JavaScriptSerializer serializer = new JavaScriptSerializer() { MaxJsonLength = Int32.MaxValue };
            PivotClientExport olapClient = new PivotClientExport();
            string args = System.Web.HttpContext.Current.Request.Form.GetValues(0)[0];
            olapClient.ExportPivotClient(string.Empty, args, System.Web.HttpContext.Current.Response);
        }
-------------------------------------------------------------------------------------------------------------------------------------------
 function Export(args) {
                                        args.url = "ExportPivotClient";
                                        args.exportChartAsImage = false;
                                    } 
-------------------------------------------------------------------------------------------------------------------------------------------
Screenshot below.

Regards,
Anis

Attachment: ExportToExcel_pbleme_2d9bb30.rar

3 Replies

SA Scintilla Arul Jothi Raj Syncfusion Team March 15, 2018 02:13 PM UTC

Hi Anis, 

Thanks for contacting Syncfusion support. 

We have checked the provided code snippet but the reported problem has not been reproduced at our end. Meanwhile, we have prepared sample for your reference. Please find the sample in below link. 
 
 
If still the problem exists, kindly reproduce the problem in the provided sample and revert us. It would be very helpful for us to investigate the problem at our end. 
 
Regards, 
Scintilla A. 



AN Anis March 15, 2018 03:19 PM UTC

Hi,
Sorry to not mention that I get the problem only with large numbers of data (multiple columns and rows), it works fine with less data.

Regards,
Anis


SA Scintilla Arul Jothi Raj Syncfusion Team March 16, 2018 12:53 PM UTC

Hi Anis, 
 
Thanks for the update. 
 
For client-mode datasource, we can achieve exporting support with the help ofJSON exportoption alone. For this kind of exporting, we will pass the serialized JSON records with other required properties from client side to server side. But by default, exception occurs when we try to pass more than 12,000 JSON records. Meanwhile we can increase the limit by setting below required properties in Web.config file with maximum limit. Please find the code snippet below for your reference. 
Code Snippet: 
<system.web.extensions> 
    <scripting> 
      <webServices> 
        <jsonSerialization maxJsonLength="2147483647"/> 
      </webServices> 
    </scripting> 
  </system.web.extensions> 
  <appSettings> 
    <add key="aspnet:MaxJsonDeserializerMembers" value="2147483647" /> 
 
The above code will increase the exporting support up to 2 lakhs. But, while exporting with styles the maximum exporting support will be up to 1.5 lakhs and by disabling  exportWithStyle property in “BeforeExport” event will provides an option to export up to 2 lakhs records for all type of exporting. Please find the below code snippet to disable exportWithStyle property. 
Code Snippet: 
function Export(args) { 
            args.url = "ExportPivotClient"; 
            args.exportChartAsImage = false; 
            args.exportWithStyle = false;   // by default it sets as true. It improves performance on exporting huge data when it sets as false. 
        } 
 
Please find the documentation link below for more details. 
Meanwhile, we have prepared a sample for your reference. Please find the sample in the below link. 
Sample Link: http://www.syncfusion.com/downloads/support/forum/136446/ze/SyncfusionMvcApplication17143075323396663747 
Please let us know if you have any concerns. 
Regards, 
Scintilla A 


Loader.
Up arrow icon