Hello, please
Is there a simple way to add a couple of rows to an excel spreadsheet ?
I want to add the title of the report and date created above the report data.
I would also like to know how I can do to change the title of the exported columns?
Tanks
Hi,
fsigu said: Is there a simple way to add a couple of rows to an excel spreadsheet ? I want to add the title of the report and date created above the report data.
Yes. What you can do is handle the BeginExport event of the UltraGridExcelExporter. The event args give you the CurrentWorksheet, so you can set the value on the cells in the first two rows to whatever you want. Then you just have to set the CurrentRowIndex so that the export of the grid data starts a few rows down.
fsigu said:I would also like to know how I can do to change the title of the exported columns?
There are a couple of ways you could do this. The easiest way would once again be in the BeginExport event. The event passes you the export layout. This is a clone of the on-screen grid's layout. So you an modify the captions on the column headers in this layout and it will affect the export without affecting the on-screen grid.
Another option would be to handle the HeaderCellExported event and set the value of the Excel cell explicitly. This would be a better solution if you want the header of a column to change based on the row or island.
We use infragistics 12.1.20121.2008 version.
I do not see a BeginExport event under the UltraGridExcelExporter.
I am trying to export few more details on the form other than the content in the Grid to excel.
Can you elaborate on including a row when clicked on export to excel.
Thank you.
Hello,
This event is obsolete now, please try using the 'ExportStarted' event instead.
Hi Boris,
I tried this event, but "e.CurrentWorksheet.Rows(0).Cells(0)" is a read only property.
How can i get a heading or a header space on the top of the excel sheet when exported to excel.
Can you please elaborate on that.
Yes, the Cell object is read-only. You need to set the Value on the cell, not set the cell itself.