Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
710
Add title to export excel file
posted

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

 

Parents
No Data
Reply
  • 469350
    Offline posted

    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.

     

Children