Posted 3 May 2023, 7:40 am EST - Updated 3 May 2023, 7:45 am EST
ActiveReports 17
Hi! How can I export a RDL Multi-Section report to memory stream? We have some older, winform reports in ActiveReports 14 that uses this code:
Dim memStream As New System.IO.MemoryStream
Dim pdfExport As New GrapeCity.ActiveReports.Export.Pdf.Section.PdfExport
Dim docAllInvoices As New GrapeCity.ActiveReports.Document.SectionDocument
pdfExport.Export(docAllInvoices, memStream)
I’m using this in a C# web service and have this code:
PageReport pageReport = new PageReport();
System.IO.FileInfo fi = new System.IO.FileInfo("C:\\My Dev\\Reports\\MyReport.rdlx");
//tried this but this fails because it's not a section report
GrapeCity.ActiveReports.Export.Pdf.Section.PdfExport pdfExport = new GrapeCity.ActiveReports.Export.Pdf.Section.PdfExport();
System.IO.MemoryStream memStream = new MemoryStream();
pdfExport.Export(pageReport, memStream);
//so tried this but this fails because of the screenshot included
GrapeCity.ActiveReports.Export.Pdf.Page.PdfExport pdfExport = new GrapeCity.ActiveReports.Export.Pdf.Page.PdfExport();
System.IO.MemoryStream memStream = new MemoryStream();
pdfExport.Export(pageReport.Report, memStream);
I tried to locate this information in the documentation but I only come up with how to do this with Section reports, like here:
https://www.grapecity.com/activereportsnet/docs/latest/online/GrapeCity.ActiveReports.Export.Pdf~GrapeCity.ActiveReports.Export.Pdf.Section.PdfExport~Export.html
Thanks!