6 Answers, 1 is accepted
I suppose you are using a ReportBook. By design when the ReportBook is exported to excel a separate sheet is created for every report. Our suggestion would be to set up a report with SubReports in code behind and export the newly created report as shown in the following code snippet:
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
I tried your code and I got the 2 report in the same worksheet, do you have any idea how I can put each one of them in separate worksheet in the same excel file?
Have you tried to combine the reports with a ReportBook? Generally when a ReportBook is exported to excel a separate sheet is created for every report.All the best,
the Telerik team
what about if we want to also include the headers and footers in this situation? or is there a way to use the report book to combine multiple reports into a single excel file but have them all show up on a single sheet?
As stated in the documentation for Excel Rendering Design Considerations:
Each report in a ReportBook will occupy a separate worksheet in the Excel workbook. Each worksheet of the Excel workbook will have the name of the respective report.
If you want multiple reports to show on a single sheet, I recommend using SubReport items.
Page-headers and -footers will no longer be available, but group-headers and -footers can be used instead in a similar way. Add a new static group to the report, meaning a group with an empty expression, which will keep the data within one collection, but make group-headers and -footer available. Each of these sections has a property called 'PrintOnEveryPage' which can be set to 'true'. When this is done, they will act very similarly to page-headers and -footers.
I hope you find this information useful. Let me know if you have any further questions.
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/.