Export FlexGrid to PDF with max rows setting

Posted by: nguyenvietloc on 23 May 2020, 3:59 pm EST

    • Post Options:
    • Link

    Posted 23 May 2020, 3:59 pm EST

    Is there setting for determines the maximum number of rows to export?

    (Similar to maxpages setting)

    For example.

    FlexGrid has 1200 rows.

    I want to export only first 300 rows to PDF?

    https://www.grapecity.com/wijmo/demos/Grid/ImportExportPrint/PDF/ExportToFile/purejs

    https://www.grapecity.com/wijmo/api/interfaces/wijmo_grid_pdf.iflexgriddrawsettings.html#maxpages

    Please help me.

    Thanks.

  • Posted 25 May 2020, 4:55 pm EST

    Hi,

    We are sorry but there is no setting for max rows. If you only wish to export top 300 rows, then there are a couple of workarounds to achieve this

    First one is to iterate over each row and if the current row will not be exported, then set its visibility to false. After exporting the grid, set the visibility of all the rows to true.

    This method is good, but if the number of rows is large, then iterating over each row will downgrade the performance. This workaround should only be used if the rows that need to be exported are not consecutive, which is not the case for you.

    Another solution is to select only those rows that need to be exported and while exporting the grid, set the exportMode to wijmo.grid.pdf.ExportMode.Selection. Setting this, will only export the selected rows. Please refer to the sample link below that demonstrates the selection workaround:

    https://stackblitz.com/edit/js-qruehj

    exportMode: https://www.grapecity.com/wijmo/api/interfaces/wijmo_grid_pdf.iflexgriddrawsettings.html#exportmode

    Regards,

    Ashwin

  • Posted 25 May 2020, 7:46 pm EST

    Another solution is to select only those rows that need to be exported and while exporting the grid, set the exportMode to wijmo.grid.pdf.ExportMode.

    Thank you for your answer!

    I will try this solution…

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels