无法将参数从c#Microsoft.Reporting.WebForms.ReportViewer传递到SSRS报告
从一个aspx,我有代码来调用SSRS报告。这段代码中的大部分都可以工作,但现在尝试传递一个参数,而该参数并没有显示在报告本身中。关于调试这个的下一步有什么想法吗无法将参数从c#Microsoft.Reporting.WebForms.ReportViewer传递到SSRS报告,c#,reporting-services,ssrs-2012,C#,Reporting Services,Ssrs 2012,从一个aspx,我有代码来调用SSRS报告。这段代码中的大部分都可以工作,但现在尝试传递一个参数,而该参数并没有显示在报告本身中。关于调试这个的下一步有什么想法吗 public partial class GenerateReports { . . . protected global::Microsoft.Reporting.WebForms.ReportViewer rptViewer; } public partial class GenerateReports : S
public partial class GenerateReports
{
. . .
protected global::Microsoft.Reporting.WebForms.ReportViewer rptViewer;
}
public partial class GenerateReports : System.Web.UI.Page
{
. . .
private void LoadReport(string reportName)
{
rptViewer.ServerReport.DisplayName = reportName;
rptViewer.ServerReport.ReportPath = LodgexConfigurationManager.ItemPath + reportName;
rptViewer.ServerReport.SetParameters(new ReportParameter("rptperiod", "1"));
rptViewer.ServerReport.Refresh();
}
}
数组工作时对ReportParameter的更改
rptViewer.ServerReport.SetParameters(new ReportParameter[] {
new ReportParameter("ManifestPeriod", reportManifestPeriod)
});
你能试试rptViewer.ServerReport.SetParameters(新的ReportParameter(“rptperiod”,1))吗代码>因为它是整数而不是字符串。