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;
}