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
343
How export to excel in more sheets and create new labels?
posted

Hi ,

i want export more XamDataGrid in different sheets of Excel  but i don't know how to do it ,do you have any idea how work out this step?

And another question ,when i export from XamDatagrid to Excel i need to create in the Excel new Rows how show the picture below :

you can see i should create 3 new  rows inserting the  label name and after in the fourth row i export the data from XamDataGrid to excel (this last step is done already) so i ask you any help to advice me how i can create those row from the code behind .

Thanks so much for your attention.

If you need more details let me know i will  reply faster.

Have a good day.

Cheers

Parents
  • 54937
    Offline posted

    gerryjj said:

    i want export more XamDataGrid in different sheets of Excel  but i don't know how to do it ,do you have any idea how work out this step?

    There are lots of overloads of the Export method on the DataPresenterExcelExporter. If you want to export multiple grids to the same workbook then you would create a workbook in code, create a worksheet and then use the overloads that take a worksheet. Since you want to insert add information before the export you might use the Export overload that takes a worksheet and starting row/column.

    gerryjj said:
    you can see i should create 3 new  rows inserting the  label name and after in the fourth row i export the data from XamDataGrid to excel (this last step is done already) so i ask you any help to advice me how i can create those row from the code behind

    The Excel assembly help topics discuss the excel api itself. Once you set the values that you want you can use the Export overloads that take the starting row/column as mentioned above. If you instead want to insert content in the middle of the export then you might handle some of the DataPresenterExportEvents. They have properties that allow you to change the CurrentRowIndex, CurrentColumnIndex, etc. For example one might handle the HeaderAreaExported event if one wanted to put something after each of the header records.

Reply Children