Hi
I am exporting grid data to Microsoft Excel and I need to add extra blank columns and rows in the Excel worksheet. These extra columns and rows do not have data associated with them and are only use to separate the data into blocks.
For example, I have 12 columns of monthly data for a financial quarter so there are 4 columns for January, 4 for February and 4 for March. I have to separate the January/February and February/March data with blank columns.
The rows are data for several categories. I have separate each category with a blank row.
I'm not clear which events and methods I can use generate this output while exporting the grid data with UltraGridCellExporter. I am using version 12.2.
Any help greatly appreciated.
Regards
James O'Doherty, Solution and Database Architect, Landesbank Berlin AG, London
Hi Patan,
This is pretty easy to do using the events on the UltraGridExcelExporter.
For example, you could handle the ExportStarted event and then write whatever data you want into the worksheet. The event args give you the CurrentWorksheet amnd CurrentRowIndex (and CurrentColumnIndex) and these are settable properties. So you could, for example, write some values to some cells in the worksheet and then adjust the CurrentRowIndex so that is' below the rows you added. The exporter will then export the grid starting at the row you specified.
Similarly, you could use ExportEnded to get the worksheet and just write whatever you want by writing to rows that are beyond the CurrentRowIndex.
Hi,
How can we insert extra rows to excel on top after all data has exported to execl from grid in asp.
Hi Hristo
I almost have the exported Microsoft Excel worksheet formatted as required however I have been unable to add a blank row immediately after the last summary value in the exported worksheet. I have tried using the SummaryRowExported event but I cannot add the blank row. Do you know how I can do this?
Any help again greatly appreciated
James
Many thanks for your help. This is exactly the functionality I was looking for.
Hello,
In order to insert blank columns only in the exported Excel file you should handle ExportStarted event of UltraGridExcelExporter and to add needed columns to the exported layout. About the blank rows you could add them to the data source before exporting and to remove them when exporting ends. I have implement my suggestion in a small sample, please run the sample and let me know if this is what you are looking for.
Please let me know if you have any further questions.