Dashboard exists but its null on render

Stimulsoft Reports.NET discussion
Post Reply
gDataTeam
Posts: 2
Joined: Wed Jul 24, 2024 1:38 pm

Dashboard exists but its null on render

Post by gDataTeam »

Hello there,

i've encountered a problem while trying to make a project. I'm trying to export into a pdf a .mrt file that i made from the designer. The .mrt file has 2 report types and 2 dashboard types. The issue is that when i'm rendering the .mrt it completely ignores the dashboards and renders only the reports, hence the pdf contains only the reports. I tried to render specifically the dashboards and from what i saw with the debugger they exist and they are there... But when the time comes for them to be rendered im getting a null exception (i even used bunch of catch/try in order to see if they are null). So i came to the conclusion that for some reason the dashboards cant be rendered cause they are null hence they cant be rendered by the report.Render() method BUT they exist so they cant be null... So any idea why this happens?

Bellow is the code and the report that i use as a sample

Code: Select all

 public StiReport ExportToPDF(StiReport report)
 { 
     report.Render();
     var pages = report.RenderedPages;

     string path = new PathHandler().PathToSave();
     StiPdfExportService pdfExportService = new StiPdfExportService();
     StiPdfExportSettings pdfExportSettings = new StiPdfExportSettings();

     using (MemoryStream stream = new MemoryStream())
     {
         pdfExportService.ExportTo(report, stream, pdfExportSettings);
         File.WriteAllBytes(path, stream.ToArray());
     }

     return report;
 }
Attachments
Report.mrt
(34.5 KiB) Downloaded 208 times
Lech Kulikowski
Posts: 7333
Joined: Tue Mar 20, 2018 5:34 am

Re: Dashboard exists but its null on render

Post by Lech Kulikowski »

Hello,

It is not possible to export a full document with reports and dashboards at once.

Thank you.
Post Reply