ParamQuery

General Category => Help for ParamQuery Pro => Topic started by: kiwon34 on July 16, 2020, 05:44:25 am

Title: Export to one excel file from multi grids.
Post by: kiwon34 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?
Title: Re: Export to one excel file from multi grids.
Post by: paramvir 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.