Hello,
I have prepared a sample demonstrating how you can export two igGrids into the same excel file into different worksheets. Since this is a custom approach it may need a slight modification if you want to export more than two grids. The approach that is taken follows the scenario that:
1) Export first grid and handle the exportEnding event
2) In the exportEnding event call a function that exports the second grid and pass the workbook that contains the first grid as argument to the function
exportEnding: function(sender, args) {
exportSecondGrid(args.workbook);
return false;
}
3) Handle the headerCellExporting event for the second grid, where you change the default workbook with the workbook we already have. Also we add a new worksheet to this workbook, where the second grid will be exported:
headerCellExporting: function(sender, args) {
if (args.columnIndex === 0) {
sender._workbook = workbook;
sender._workbook.worksheets().add(sender._worksheet.name());
sender._worksheet = sender._workbook.worksheets(1)
}
},
Please note there is a slight drawback of this scenario: since we add the new worksheet when exporting headers had started, the second worksheet will have default strings applied to column names. This can be corrected for example in headerCellExported event. Please let me now if you would need assistance on how to achieve this.