I have an WinForm application with multiple infragistics UltraGrids. Can I export all the grids to excel at once, with each grid using it's own worksheet in one workbook? A simple example would be greatly appreciated.
Thanks,
Sherry
You can create your own Workbook instance, add Worksheets to it, and export directly to those Worksheets:
Workbook workbook = new Workbook();
Worksheet sheet1 = workbook.Worksheets.Add("Sheet1");
this.ultraGridExcelExporter1.Export(this.ultraGrid1, sheet1);
Worksheet sheet2 = workbook.Worksheets.Add("Sheet2");
this.ultraGridExcelExporter1.Export(this.ultraGrid2, sheet2);
// ...
workbook.Save("C:\\grids.xls");
Mike,
Thank you for the reply. What is a workbook in your example (i.e. what are your reference and imports statements?). Workbook.Save does not seem to be a method available in Infragistics.Excel.Workbook.
Thank you,
Excellent. Thank you so much.
You have the correct class, but you may have an earlier version. Save was only added in version 7.2. You can just use the BIFF8Writer.WriteWorkbookToFile static method instead.