PDF Export Column Resize

Hi Team,


  1. How to Change PDF Export Column Width 
  2. How to export only selected columns instead of all columns
  3. What is the pdf export no of columns limit for portrait or landscape
  4. Sometime when export stuck in infinite loop and never return, when either no of columns more than expected for data in cell in bigger than as pdf expect
  5. When I set below mention code in exportproperties and giving headercontext more that expected than export function stuck in infinite loop never return 
  6.  header: {
                        fromTop: 0,
                        height: 50,
                        contents: headerContent
                    },

3 Replies

VB Vinitha Balasubramanian Syncfusion Team July 8, 2022 05:28 PM UTC

Hi Nagendra Gupta,


Greetings from Syncfusion support.


Currently, we are validating the reported query with the provided information at our end. We will provide further details on  July 12th, 2022.


We appreciate your patience until then.


Regards,

Vinitha Balasubramanian



VB Vinitha Balasubramanian Syncfusion Team July 18, 2022 01:33 PM UTC

Hi Nagendra Gupta,


Thanks for your patience.


Query 1 : How to Change PDF Export Column Width


Based on your query, we want to convey that by default the default column width will be set to the pdf exported Grid also. If you want to customize this width, we can change the width on toolBarClick event.


Kindly refer the below code and sample for your reference.


[index.js]

toolbarClick(argsClickEventArgs): void {

    if (args.item.text === 'PDF Export') {

      (this.grid.columns[3as Column).width = 250;

    }

    this.grid.pdfExport();

  }


Sample link : https://stackblitz.com/edit/angular-bxsd5f-5ace9r?file=app.component.ts,app.component.html,app%2Fapp.module.ts,package.json


Query 2 : How to export only selected columns instead of all columns


We have analyzed your query, we have already discussed about this topic in our UG documentation. Kindly refer the below documentation to achieve your requirement.


Documentation link : https://ej2.syncfusion.com/angular/documentation/grid/pdf-export/pdf-export-options/#show-or-hide-columns


Query 3 : What is the pdf export number of columns limit for portrait or landscape


Since the width of the columns will be vary for each Grid, there is no explicit limitation for number of columns.

However we can change the page size depends on the column length using pdfExportProperties, kindly refer the below documentation for further references.


Documentation link : https://ej2.syncfusion.com/angular/documentation/grid/pdf-export/pdf-export-options/#change-page-size


Query 4 : Sometime when export stuck in infinite loop and never return, when either no of columns more than expected for data in cell in bigger than as pdf expect


Based on your query, we suspect that you were exporting large number of data from the grid and  the performance becomes slow while exporting large number of data because export action performs depends on cell manipulation. So We suggest the server side exporting to resolve your reported problem.


Documentation link : https://ej2.syncfusion.com/documentation/grid/pdf-export/exporting-grid-in-server/


Query 5 : When I set below mention code in exportproperties and giving headercontext more expected than export function stuck in infinite loop never return.


Currently, we are validating your query, we will update further details on July 20th, 2022. Until then we appreciate your patience.  


Regards,

Vinitha Balasubramanian



VB Vinitha Balasubramanian Syncfusion Team July 20, 2022 12:54 PM UTC

Hi Nagendra Gupta,


Thanks for your patience.


Query 5 : When I set below mention code in exportproperties and giving headercontext more expected than export function stuck in infinite loop never return.


We have prepared a sample to replicate your reported problem at our end. But its working fine, kindly refer the below sample for reference.


Sample link : https://stackblitz.com/edit/angular-bxsd5f-wv2lxf?file=app.component.ts,app.component.html,app%2Fapp.module.ts,package.json


If you still face the same issue kindly share the below details with us to validate your query further.


  • Please try to reproduce the issue in given sample and confirm with us.
  • Share the complete Grid code files and package.json file


Regards,

Vinitha Balasubramanian


Loader.
Up arrow icon