子报表处理事件未触发

Mai*_*ead 3 c# wpf rdlc subreport

我在WPF中使用rdlc报告,所以使用WindowsFormsHost包装器已经这样做了.我正在寻找运行的rdlc报告中嵌入了一个子报告,我正在使用ReportViewer的SubreportProcessing事件设置它的数据源.

Viewer.LocalReport.SubreportProcessing += new SubreportProcessingEventHandler(LoadAccessoriesSubReport);
Run Code Online (Sandbox Code Playgroud)

我的问题是SubreportProcessing事件甚至没有被触发.我在Window_Loaded包含嵌入式ReportViewer控件的WPF窗口中定义它,请参阅下面的xaml:

       Title="ReportViewer" Height="1000" Loaded="Window_Loaded" Width="1000">
<Grid>
    <WindowsFormsHost Name="winHost">
        <wf:ReportViewer  Dock="Fill" Name="rptViewer">
        </wf:ReportViewer>  
    </WindowsFormsHost>                   
</Grid>
Run Code Online (Sandbox Code Playgroud)

非常感谢任何帮助.

pic*_*rap 6

检查子报表参数.如果参数条件失败,则不加载子报表.还要检查Visual Studio跟踪输出,它会显示哪个参数导致错误.

要执行快速检查,请将所有子报表参数设置为允许为null.

它为我做了诀窍(现在,我只需要理解为什么我得到一个空值而不是预期的:))