Hello i have a problem using RDLC subreports. I have a very simple setup where i have persons and their residences.
The problem is that the subreport containing the residence for each person is not loaded, because the SubreportProcessing Event is never fired.
I have set up my reportviewer like this:
private void LoadAnniversaryReport()
{
DataSet dt = new ResidentSearchServiceClient().GetAnniversaries();
residenceDataTable = dt.Tables[1];
ReportDataSource personDataSource = new ReportDataSource("Dataset", dt.Tables[0]);
this.ReportViewer.LocalReport.ReportPath = "Reports\\Anniversary\\Anniversary.rdlc";
this.ReportViewer.LocalReport.DataSources.Clear();
this.ReportViewer.LocalReport.DataSources.Add(personDataSource);
this.ReportViewer.LocalReport.SubreportProcessing += ResidenceSubreportProcessing;
this.ReportViewer.Refresh();
this.ReportViewer.RefreshReport();
_isReportViewerLoaded = true;
}
The subreport has a Parameter called "Id". Here's the xml of the subreports parameter definition:
<ReportParameters>
<ReportParameter Name="Id">
<DataType>Float</DataType>
<Nullable>true</Nullable>
<Prompt>ReportParameter1</Prompt>
</ReportParameter>
</ReportParameters>
And the parents subreport and parameter definition
<Subreport Name="PersonResidences">
<ReportName>PersonResidences</ReportName>
<Parameters>
<Parameter Name="Id">
<Value>=Fields!ENTITYID.Value</Value>
</Parameter>
</Parameters>
<OmitBorderOnPageBreak>true</OmitBorderOnPageBreak>
<Style>
<Border>
<Style>None</Style>
</Border>
</Style>
</Subreport>
The "ReportName" is the exact name of the report on the file system without the .rdlc extension. Both reports are in the same subdirectory.
The parent report works fine without the subreport.
I know this question has been asked before, but none of the answers seem to solve my problem.
Any help would be greatly appreciated.
Edit: Followed this tutorial and experienced the exact same problem https://www.c-sharpcorner.com/article/rdlc-subreport-using-c-sharp-and-wpf/