【发布时间】:2012-01-30 13:54:25
【问题描述】:
我创建了 4 个报告,其中包含来自数据库中 4 个表的信息。在我的应用程序中,我有一个 menuStrip,其中包含名为此报告的项目。如何让我的应用程序reportViewer 显示在menuStrip 中选择的报告?
我试过这段代码:
ReportDataSource RDS = new ReportDataSource();
RDS.Value = this.KontrolorKazneBindingSource;
reportViewer1.LocalReport.DataSources.Add(RDS);
reportViewer1.LocalReport.ReportPath = @"C:\Users\User\documents\visual studio 2010\Projects\Kontrolor\Kontrolor\KontrolorKazne.rdlc";
reportViewer1.RefreshReport();
但我得到一个错误:A data source instance has not been suplied for the data source
你能告诉我我做错了什么以及如何解决这个问题吗?
【问题讨论】: