【发布时间】:2014-07-20 14:10:52
【问题描述】:
我有一个使用两个子报告的主 SSRS 报告。主报告有两个参数需要传递给子报告。
我正在使用 Visual Studio 2010 和 SQL Server 2005。
RViewer1.ProcessingMode = ProcessingMode.Local;
RViewer1.LocalReport.ReportPath = Server.MapPath("~/Reports/MOM.rdlc");
ReportDataSource datasource = new ReportDataSource("meetingmaster", getdt);
RViewer1.LocalReport.DataSources.Clear();
RViewer1.LocalReport.DataSources.Add(datasource);
ReportParameter[] reportParameterCollection = new ReportParameter[1]; //Array size describes the number of paramaters.
reportParameterCollection[0] = new ReportParameter();
reportParameterCollection[0].Name = "mrefno"; //Give Your Parameter Name
reportParameterCollection[0].Values.Add(mref); //Pass Parametrs's value here.
RViewer1.ServerReport.SetParameters(reportParameterCollection);
RViewer1.ServerReport.Refresh();
【问题讨论】:
-
您的主报告不应该将所有参数传递给子报告吗?
-
仅当子报表需要所有参数时。
标签: asp.net reporting-services