We are currently generating TRDX reports using the Telerik Report Designer tool, saving the XML output to a database. When a user runs a report, we retrieve the report XML, update the parameters, and then render the report using the Report Processor. However, we now need to export the report into multiple Excel tabs.
One potential solution is to use Report Book, which is stored in a TRBP file, but we're having trouble reading the contents of this file. Are there any alternative approaches we could take to achieve this functionality?
Hello Rajesh. It looks like there is some option for exporting Excel files with multiple sheets since R2 2022 (if I'm not mistaken). Do you think this documentation would be relevant in your setup -> https://docs.telerik.com/reporting/doc-output/configure-the-export-formats/excel-2007-device-information-settings
It states that there is a property called "SplitWorksheetOnPageBreak" that could be helpful in your case.
There may be some workaround for working with the TDBP files but they are dirty approaches - e.g. storing the binary file in a BLOB column in the DB or renaming the TRBP file to ZIP and storing the text files inside the archive.
Regards,
Krasi
Hi Krasi,
Thank you for the response. I have tried to add page break on report and tried to export with UseSheetName but no luck. Can you share any sample code to set SplitWorksheetOnPageBreak option?
Hello Rajesh,
What technology are you using to visualize/render the reports? You should be able to set the programmatically. Below I can share some details using the standalone designer.
I managed to split the excel into multiple sheets using the standalone designer. Here are some details:
When using the config xml file you need to add the extensions under the <configuration> element.
Below are some links that helped me handle this:
When exporting the documents programatically you would need to use the device info settings -> https://docs.telerik.com/reporting/embedding-reports/generate-reports-locally
Hi Krasi,
I have looked into attached report and seen page break for header section but when export from designer both tables appear in same sheet. I have updated config file as well. Strange thing is it export PDF in two pages but not in excel.
<Telerik.Reporting> <Extensions> <Render> <Extension name="XLSX" description="Excel new"> <Parameters> <Parameter name="SplitWorksheetOnPageBreak" value="true"/> <Parameter name="DShowGridlinespiY" value="true"/> </Parameters> </Extension> </Render> </Extensions> </Telerik.Reporting>
We are storing trdx contents into DB and exporting using Report processor with device info. Please check below device info code and correct me if it is wrong.
private static Hashtable GetDeviceInfo(ExportType? exportType = null, bool useMultipleSheets = false) { Hashtable deviceInfo = new Hashtable { { "ViewerFitWindow", true }, { "EnableAccessibility", true } }; if (exportType == ExportType.Excel || useMultipleSheets) { deviceInfo.Add("SplitWorksheetOnPageBreak", true); deviceInfo.Add("UseSheetName", true); } return deviceInfo; }
Thanks
Hi Rajesh and Krasi,
Please let me join your conversation.
Rajesh, could you specify what version of Telerik Reporting you are using in your project? Please note that the device info setting called SplitWorksheetOnPageBreak was added in version 16.1.22.622:
For your convenience, I am attaching a sample console application built against .NET 8 and the latest version of Telerik Reporting. There, I am utilizing the sample report file Krasi provided, and it indeed renders on two tabs:
Therefore, I have a suspicion that you may be using an older version of the product. In this case, upgrading may help resolve the problem.
If this is not the case, please feel free to take a look at the sample project I provided, as it may help identify the cause of the issue. In case you are unable to do so, it would be very helpful if you could provide a sample demo project as well where the issue can be reproduced. Thank you!
Regards,
Petar
Hi Petar,
Thank you for the response. Yes, your assumption is correct. We are using older version of Telerik Reporting. Please consider to close this issue. Thanks