I have seen the article on how to export to pdf without going through the viewer, but it does not seem to aply to a report book (it may just be me :))
Could I have an example where several reports are added to a report book and then the report book is sent directly to PDF?
1 Answer, 1 is accepted
0
Stef
Telerik team
answered on 25 Mar 2016, 12:56 PM
Hello Steven,
The ReportBook object is the same as the Report object. The ReportBook is treated as a single document on display, export, print.
Please check the ReportBook example in the local demos installed by default underC:\Program Files (x86)\Telerik\Reporting Q1 2016\Examples.
If you want to create the ReportBook at run-time and export it programmatically, test the following approach:
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 Feedback Portal
and vote to affect the priority of the items
I had to manually open trbp files and read definition xml file to extract trdp files and add it to reportbook.
Then I am able to export PDF in the backend.
// Telerik.Reporting.XmlSerialization.ReportXmlSerializer xmlSerializer = new Telerik.Reporting.XmlSerialization.ReportXmlSerializer(); // reportBook = (Telerik.Reporting.ReportBook)xmlSerializer.Deserialize(streambook); //} //foreach (var item in reportBook.Reports) //{ // MemoryStream ms1 = new MemoryStream(); // using (FileStream file = System.IO.File.OpenRead(item.Report.DocumentName)) // { // file.CopyTo(ms1); // }
//}
using (var zip = new ZipArchive(streambook, ZipArchiveMode.Read)) { var entr = zip.Entries.Where(x => x.Name.StartsWith("definition")).FirstOrDefault(); var audit = zip.GetEntry("definition.xml"); StreamReader reader = new StreamReader(entr.Open()); string text = reader.ReadToEnd(); XmlDocument doc = new XmlDocument(); doc.LoadXml(text);