【发布时间】:2016-03-17 22:37:05
【问题描述】:
ReportViewer1.LocalReport.DataSources.Clear();
LocalReport rep = ReportViewer1.LocalReport;
ReportDataSource rds = new ReportDataSource();
rds.Name = "DataSet1"; //this is the name of the DataSet on your report rdlc
ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("dataset1", ObjectDataSource1));
rep.ReportPath = "Report1.rdlc";
DataSet ds = new DataSet();
【问题讨论】:
-
我已经使用数据集通过报表向导创建了数据源。
-
另外,我正在尝试使用 c# 在 sql server 上自动生成报告,并且它必须是基于 Web 的。最终用户需要根据日期重试数据。
-
为什么不用这些额外的花絮更新您的问题,而不是添加 cmets Spo-dee-o-dee?
-
尝试从名称中删除引号(DataSet1 而不是“DataSet1”)
-
还告诉我们你的代码会发生什么。到目前为止,您问题正文中的 only 文本是代码,但没有表明您正在尝试做什么或出了什么问题。
标签: c#