Two radgridview on the same excel file

1 Answer 71 Views
GridView
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Deltaohm asked on 17 Mar 2023, 04:19 PM

Hi,

Is it possible to export two radgridview in the same file excel on different worksheet?

Thank you

Luigi

1 Answer, 1 is accepted

Sort by
0
Accepted
Martin Ivanov
Telerik team
answered on 20 Mar 2023, 10:27 PM

Hello Luigi,

Yes, but you will need to put some extra work here. RadGridView internally uses the Telerik RadSpreadProcessing library to export its data to Excel formats. You can use the ExportToWorkbook method in order to get the Workbook object part of RadSpreadProcessing. You can get two Workbook objects from the two RadGridView instances. Then, you can use the RadSpreadProcessing APIs to merge these into a single document and export it to a file

To merge two Worbook documents, you can get the Worksheet of the second document and add it in the Worksheets collection of the first one (or vice versa).

I hope that helps. 

Regards,
Martin Ivanov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
GridView
Asked by
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Answers by
Martin Ivanov
Telerik team
Share this question
or