hi
i have win form with 3 tabs. each tab has ultra win grid.
i want to export the 3 grids from the 3 tabs to the same excel file, each grid in new sheet of excel.
how can i do this? i searched in the net and didnt find an answer.
Thanks, Michal
Attached is a sample containing a form that has 3 tabs & 3 grids. I placed the export code in the button click event, but I'll put the code below as well.
Infragistics.Documents.Excel.Workbook workbook = new Infragistics.Documents.Excel.Workbook(); Infragistics.Documents.Excel.Worksheet worksheet1 = workbook.Worksheets.Add("Grid 1"); Infragistics.Documents.Excel.Worksheet worksheet2 = workbook.Worksheets.Add("Grid 2"); Infragistics.Documents.Excel.Worksheet worksheet3 = workbook.Worksheets.Add("Grid 3"); ultraGridExcelExporter1.Export(grid1, worksheet1); ultraGridExcelExporter1.Export(grid2, worksheet2); ultraGridExcelExporter1.Export(grid3, worksheet3); try { workbook.Save("output.xls"); System.Diagnostics.Process.Start("output.xls"); } catch { MessageBox.Show("Please close any open instances of Excel.", "Error Opening Workbook", MessageBoxButtons.OK, MessageBoxIcon.Stop); }