Posted 11 September 2019, 11:49 pm EST
In AR11 reporting service it was possible to do a custom report export like this
MemoryStream m_stream = new MemoryStream();
try {
//assuming this is a proper report. Could also be a PageReport
SectionReport rpt = new SectionReport();
rpt.Run();
PdfExport pdfExport = new PdfExport();
pdfExport.Options.OnlyForPrint = true;
pdfExport.Export(rpt.Document, m_stream);
return Convert.ToBase64String(m_stream.ToArray());
} catch (Exception ex) {
throw new MicroServicesException(log, reportPreviewOptions.CoreURL, reportPreviewOptions.Token, $"Unable to Get PDF Data -> [ExMessage: {ex.Message}]", ex, new object[] { reportPreviewOptions.CoreURL, reportPreviewOptions.ReportID, reportPreviewOptions.Token });
} finally {
log.Info($"END: ExportPDF");
}
However the Web Designer service uses a different type of report object -“GrapeCity.ActiveReports.PageReportModel.Report”. This object is not compatible with the above mentioned export method.
What would be the correct way of doing this export in the AR13 Web Designer service?