Posted 15 October 2020, 4:53 am ESTI'm trying to render a page report with two sections; one is landscape and one is portrait. I found the code to add the pages of one report to another here. https://www.grapecity.com/blogs/how-to-create-pages-of-mixed-orientation-in-activereports But, I need to render the reports in one pdf. Is there an example of how to merge the 2 reports. Or a way to change the orientation of 2 pages in a report?
Mixed Orientation report rendered in pdf
Posted by: akoenig on 15 October 2020, 4:53 am EST
Replied 15 October 2020, 7:24 pm ESTHello,
In the mentioned blog, "rpt2" report is added in the "rpt" report. So when you export the "rpt" report, it will export the content of the both report. Request to please confirm when you are doing the same, are you receiving the different result.
Replied 16 October 2020, 12:14 am ESTI'm trying to render the report directly to PDF.
pageReport.Document.Render(pdfRenderingExtension, outputProvider, pdfSetting, true);
Is there a way to render both reports and merge them?
Replied 18 October 2020, 10:18 pm ESTHello,
You can create two report with different orientation and export into RDF.
You can use the RDFRenderingExtension to convert your RDL report to RDF. Please refer to the following lines of code:
GrapeCity.ActiveReports.PageReport pr = new GrapeCity.ActiveReports.PageReport(new System.IO.FileInfo("../../PageReport1.rdlx"));
System.IO.DirectoryInfo outputDirectory = new System.IO.DirectoryInfo(@"C:\MyRDF");
GrapeCity.ActiveReports.Export.Rdf.RdfRenderingExtension re = new GrapeCity.ActiveReports.Export.Rdf.RdfRenderingExtension();
GrapeCity.ActiveReports.Export.Rdf.Settings s = new GrapeCity.ActiveReports.Export.Rdf.Settings();
GrapeCity.ActiveReports.Rendering.IO.FileStreamProvider fs= new GrapeCity.ActiveReports.Rendering.IO.FileStreamProvider(outputDirectory, System.IO.Path.GetFileNameWithoutExtension(outputDirectory.Name));
After that, You can load the generated RDF file into the SectionDocument class using the "Load" method(https://help.grapecity.com/activereports/webhelp/AR13/webframe.html#GrapeCity.ActiveReports.Document~GrapeCity.ActiveReports.Document.SectionDocument~Load.html).
After that, you can use the following lines of code to merge the report:
for (i=0; i < SectionDocument1.Pages.Count; i++)
After that you can use the following line of code to export the SectionDocument2 into PDF:
Hope it helps.