Author Topic: Export all page data in exportData  (Read 1762 times)

Digitalsoft

  • Pro OEM
  • Newbie
  • *
  • Posts: 49
    • View Profile
Export all page data in exportData
« on: August 18, 2020, 07:14:44 pm »
Team, We have a requirement where we are using pagination to display data(to avoid loading all data at once). When user clicks export option we need to export all data. Is there any way to pass data as parameter to exportData method or do we have any suggestion to achieve the result. Thanks!

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6309
    • View Profile
Re: Export all page data in exportData
« Reply #1 on: August 19, 2020, 09:14:37 am »
exportData can only export the data which is available on client side ( browser / grid ). Since in remote paging only the data for current page is available in the grid, exportData has no way to export rest of the data.

One way to bypass loading all data in grid and still export all data to Excel is as below:

Upon click of Export button:

Steps:

1. Load all data from server via Ajax call.

2. Create a javascript workbook by combining grid colModel and data received from server.

3. Export js workbook to Excel.

Drawback of the above approach is that

1. user would have to wait until all the data is loaded from server
2. any computations like formulas or formatting taking place in the grid would be ignored.

Digitalsoft

  • Pro OEM
  • Newbie
  • *
  • Posts: 49
    • View Profile
Re: Export all page data in exportData
« Reply #2 on: August 19, 2020, 04:18:34 pm »
yes, the first drawback is understandable and user would wait since export option is used few times.
Since, we have defined few computed column in grid, the alternative approach may not work for us in this scenario.
however we appreciate your suggestion/ details .