Download to excel while using pagination

Posted by: parmarkinjalk on 11 April 2020, 7:46 pm EST

  • Posted 11 April 2020, 7:46 pm EST

    Hi Team ,

    I have a grid with pagination(wj-collection-view-pager) and I am trying to download the grid but it is only downloading the rows on the current page.

    This is what my requirement is- I have around 1500-2000 rows with pagination and users will filter it down. I want to download that filtered list even if it is on multiple pages. Thanks.

    export(grid) {
      var book = gridXlsx.FlexGridXlsxConverter.save(this.grid, { includeColumnHeaders: true, 
        includeRowHeaders: true });
        //name the sheet
        book.sheets[0].name = 'FlexGrid Data';
        // save the book
        book.save('FlexGrid-Export.xlsx');
    }
    
  • Posted 13 April 2020, 4:10 am EST

    Hi Kinjalk,

    The excel file is exported on the basis of FlexGrid and not the data bound to the FlexGrid. While using paging, only some of the data is shown on the grid and therefore only this data is exported.

    If you need to export the whole data, then you will need to remove the paging from the grid and re-apply it again after the export. Refer to the sample link below for reference:

    https://stackblitz.com/edit/angular-1fdqzn-qklbfy

    Regards,

    Ashwin

Need extra support?

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

Learn More

Forum Channels