Grid PDF Export with more than 5000 rows takes a huge amount of time

We are using Data Grid in one of our pages in the web application.  The data grid displays data from the backend using the ajax call. The user has the ability to export to excel and pdf.

Export to excel is pretty fast when the data is huge. However, export to pdf takes a very long time to export. I have attached the source code. Please run index.html to replicate the issue.

Please let me know if we can improve the pdf performance.

Attachment: BrokerPortal_Server_Replication_b1980c99.zip

5 Replies 1 reply marked as answer

BS Balaji Sekar Syncfusion Team June 3, 2020 03:05 PM UTC

Hi Naveen, 
 
Greetings from the Syncfusion support. 
 
We have analyzed your with provided code example, we have suggest to use column define in pdfHeaderQueryCellInfo event instead of pdfQueryCellInfo event of Grid. Because of pdfQueryCellInfo event invoked by every cell rendering generate Grid to Pdf file. please refer the below code example and documentation for more information. 
<script> 
    function pdfHeaderQueryCellInfo(args) { 
 
        if (args.gridCell.column.field === 'OrderID') { 
            // you can get column by using the getColumn 
            args.cell.gridRow.pdfGrid.columns.getColumn(this.getColumnIndexByField(args.gridCell.column.field)).width = 170 
        } 
        if (args.gridCell.column.field === 'CustomerID') { 
            // you can get column by using the getColumn 
            args.cell.gridRow.pdfGrid.columns.getColumn(this.getColumnIndexByField(args.gridCell.column.field)).width = 60 
        } 
        if (args.gridCell.column.field === 'Freight') { 
            // you can get column by using the getColumn 
            args.cell.gridRow.pdfGrid.columns.getColumn(this.getColumnIndexByField(args.gridCell.column.field)).width = 60 
        } 
        if (args.gridCell.column.field === 'Verified') { 
            // you can get column by using the getColumn 
            args.cell.gridRow.pdfGrid.columns.getColumn(this.getColumnIndexByField(args.gridCell.column.field)).width = 60 
        } 
 
    } 
 
</script> 
 

Please get back to us, if you need further assistance. 

Regards, 
Balaji Sekar. 



NR NAVEEN RAAJU June 6, 2020 02:13 AM UTC

I made changes based on your suggestion but still i encounter the same issue.  Please run index.html to replicate the issue.

Attachment: BrokerPortal_Server_Replication_a17a03e9.zip


BS Balaji Sekar Syncfusion Team June 8, 2020 05:15 AM UTC

Hi Naveen, 
 
Thanks for your update. 
 
We have analyzed your query with provided sample and we suspect that you have custom font applied in the Pdf export file. since this is cause of the problem because of you have defined font-family(“calibri”) to directly but we can allow this custom font in base64 format in the pdfExportProperties(index.js). So we suggest you use the below documentation to help achieve custom font apply in your application. 
  
                                          https://ej2.syncfusion.com/javascript/documentation/grid/pdf-export/?no-cache=1#add-custom-font-for-pdf-exporting 

Please get back to us, if you need further assistance. 

Regards, 
Balaji Sekar 


Marked as answer

NR NAVEEN RAAJU June 16, 2020 08:07 PM UTC

Thanks for the prompt response. It works now based on the below link.


BS Balaji Sekar Syncfusion Team June 17, 2020 04:30 AM UTC

Hi Naveen, 
  
We glad that your issue has been fixed.  
  
Please get back to us if you require further other assistance from us. 
  
Regards, 
Balaji Sekar. 


Loader.
Up arrow icon