I have an issue where I am trying to export to excel. I am doing so with no problem. The thing is that the end user is asking if I can add more to the export. I am already exporting a single infragistics UltraWebGrid. On the design of my page there is also other controls which the end user wants to be exported to excel to include Drop Down Lists, Text boxes, and labels. This is where I am at I can create another grid with all this information in it and make it not visible to the end user and have it export. But when I try to export this grid it just overwrites the current grid export so I am now only getting this grid. I figured that this is do to the fact that I am using the same UltraWebGridExcelExporter. So I use two them but they come back on two different excel workbooks/worksheets. They are related and I want to put them on the same worksheet if possible. Is this possible? Am I over working this missing something or someway simplify this?
If you want to allocate some Worksheet rows (say, 1-9) at the top of the Worksheet for additional headings, labels, text boxes/drop down list selected text (which will appear literally as text when exported, not as a dropdown), then WebGridExcelExporter has some features that will make that easier for you.
WebGridExcelExporter class overview
There is an ExcelStartRow property you can set to 10, this will cause the WebGrid being exported to start exporting 10 rows down on the Worksheet (leaving rows 1-9 vacant).
There are also overloads of the Export method. What you will want to do is construct a Workbook object on your own, start setting text values on its Worksheet in rows 1-9 (for this example) with values from your labels, textboxes, dropdown list selected text, and then pass the Workbook, the Worksheet, and the starting row number to the Export method -- there's an overload for that. :)
You can also add labels, textbox values, dropdown list selected text.. at the bottom of the exported data grid through the Worksheet API. The only trick is finding out where in the Worksheet was the bottom of the data grid exported. You can capture this value from EventArgs passed into the last RowExported event fired, or perhaps the EndExport event.