Author Topic: Export to one excel file from multi grids.  (Read 1537 times)

kiwon34

  • Pro Ultimate
  • Jr. Member
  • *
  • Posts: 52
    • View Profile
Export to one excel file from multi grids.
« on: July 16, 2020, 05:44:25 am »
Is there a way to export data from two grids to one excel sheet?

In the excel sheet, first grid's header and data are shown at top, and the second grid's header and data are shown right below them separated by one or two rows. Is this possible?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6309
    • View Profile
Re: Export to one excel file from multi grids.
« Reply #1 on: July 16, 2020, 09:31:59 am »
Yes it can be done by

1. Export both grids as workbooks ( say w1 and w2 )

2. Add empty rows {} to w1.sheets[0].rows

3. Add rows from w2.sheets[0].rows to w1.sheets[0].rows

4. Export w1 to Excel file.

You might also require to adjust row.indx of w2.sheets[0].rows in the process for which schema of workbook would be useful:

https://paramquery.com/pro/api/excel-workbook

Examples on manipulating workbooks / sheets:

https://paramquery.com/pro/demos/export_sheets

https://paramquery.com/pro/demos/export_detail

Please let me know if you need any further help.