Coming back to this request, I'm using now Blazor Server 19.3 and I need this time to use RDLC with a subreport inside a report
Using this piece of code I found in your documentation:
// Method will be called to initialize the report information to load the report with ReportHelper for processing.
public void OnInitReportOptions(ReportViewerOptions reportOption)
{
string basePath = _hostingEnvironment.WebRootPath;
if(reportOption.ReportModel.ReportPath.Substring(reportOption.ReportModel.ReportPath.IndexOf(".")+1) == "rdlc")
reportOption.ReportModel.ProcessingMode = ProcessingMode.Local;
if (reportOption.SubReportModel != null)
{
string path = basePath + @"\resources\FatCliDetSub.rdlc";
FileStream SubStream = new FileStream(path, FileMode.Open, FileAccess.Read);
reportOption.SubReportModel.Stream = SubStream;
}
else
{
FileStream reportStream = new FileStream(basePath + @"\resources\" + reportOption.ReportModel.ReportPath, System.IO.FileMode.Open, System.IO.FileAccess.Read);
reportOption.ReportModel.Stream = reportStream;
}
}
// Method will be called when reported is loaded with internally to start to layout process with ReportHelper.
public void OnReportLoaded(ReportViewerOptions reportOption)
{
if (reportOption.SubReportModel != null)
{
}
}
In the underlined step, the reportOption.SubReportModel is correctly loaded but then, inside "OnReportLoaded" event, the reportOption.SubReportModel is null
why this happens ?
Thanks
Best Regards
Thank you Manoranjan, my mistake, I didn't follow exactly what was suggested in the documentation.
Your sample gave me the right way to proceed
Best Regards