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); }
I'm still not able to get this working. Could you supply code? My situation is similar to OP with the only difference being in the number of tabs/columns on my app.
I was declaring with workbook with the "New" keyword. Silly me.
I have tried numerous different methods talked about in this forum including this one and many others and multiple scenarios bring back the same error message.
Retrieving the COM class factory for component with CLSID {00020819-0000-0000-C000-000000000046} failed due to the following error: 80040154.
I googled it and attempted the solution listed here with no luck. Any ideas?
currently using infragistics 2006, excel 2007, and visual studio 08.
Thanks
The .Export does not take in a grid, worksheet, and WorkbookFormat. How do you do this if you are exporting to Excel2007?
Edit: never mind, apparently the worksheets formats are exactly the same. It is only the workbook that matters.