SubreportProcessing Event not Firing

c#, rdlc, subreport, wpf

Solution

Check your subreport parameters. If a parameter condition fails, the subreport is not loaded. Also check Visual Studio trace output, it shows which parameter causes the error.

In order to perform a quick check, set all subreport parameters to allow null.

It did the trick for me (now, I just need to understand why I get a null value instead of the expected one :))

Problem

I'm using rdlc reports in WPF, so have done so using WindowsFormsHost wrapper. The rdlc report I'm looking for run has a subreport embedded in it, and I'm setting the data source of that using the SubreportProcessing event of the ReportViewer. ``` Viewer.LocalReport.SubreportProcessing += new SubreportProcessingEventHandler(LoadAccessoriesSubReport); ``` My problem is that the SubreportProcessing event doesn't even get fired. I'm defining it in the `Window_Loaded` event of the WPF window which contains the embedded ReportViewer Control, see xaml below : ``` Title="ReportViewer" Height="1000" Loaded="Window_Loaded" Width="1000"> <Grid> <WindowsFormsHost Name="winHost"> <wf:ReportViewer Dock="Fill" Name="rptViewer"> </wf:ReportViewer> </WindowsFormsHost> </Grid> ``` Would appreciate any help on this.

Original source