【发布时间】:2011-11-15 16:42:06
【问题描述】:
我目前正在尝试使用多个报告,以便当用户从 WPF 应用程序的上下文菜单中选择一个项目时,报告表单会与所选报告一起出现。如果从上下文菜单中选择了每周,则需要在报告表单中显示每周报告。
我没有收到编译时错误,但我的报告查看器显示以下“本地报告处理期间发生错误。尚未指定报告'Reports.Report3.rdlc' 的报告定义。”
我在点击上下文菜单项时使用下面的代码
Reports.Form1 Reports = new Reports.Form1();
Reports.reportViewer1.Reset();
Reports.reportViewer1.LocalReport.DataSources.Clear();
ReportDataSource reportDataSource1 = new ReportDataSource();
Reports.SpecificationsTableAdapter.Fill(Reports.RocketToolsDataSet.Specifications);
reportDataSource1.Name = "TestDataSet";
reportDataSource1.Value = Reports.SpecificationsBindingSource;
Reports.reportViewer1.LocalReport.DataSources.Add(reportDataSource1);
Reports.reportViewer1.LocalReport.ReportEmbeddedResource = "Reports.Report3.rdlc";
Reports.reportViewer1.Name = "reportViewer1";
Reports.reportViewer1.RefreshReport();
Reports.Show();
loading.Close();
报告表单的项目名称为 Reports,WPF 应用程序的项目名称为 RocketTools。我在我的 WPF 项目中引用了 Reports 项目。如果报告是在报告表单中加载的默认设置,则加载正常。但是当我尝试在我的 WPF 应用程序中更改表单加载的设置时,我得到了上面的错误。
谁能帮帮我
【问题讨论】:
标签: c# wpf reporting multiple-projects