我正在使用 C# 呈现来自 SRSS 2008 R2 的报告 该报告具有参数,并且很长一段时间以来我在呈现输出时都没有问题。然而今天它决定它不去工作!
这是错误
ReportServerException: This report requires a default or user-defined value for the report parameter 'CustomFieldId'. To run or subscribe to this report, you must provide a parameter value. (rsReportParameterValueNotSet): Stack: at Microsoft.Reporting.WebForms.ServerReportSoapProxy.OnSoapException(SoapException e)
这是代码:
ReportViewer rv = new ReportViewer();
rv.ShowCredentialPrompts = true;
rv.ProcessingMode = ProcessingMode.Remote;
rv.ServerReport.ReportServerUrl = new Uri(ReportsClient.ReportServerUrl);
rv.ServerReport.ReportPath = string.Format("/Reports/{0}", item.Name);
rv.ServerReport.SetParameters(thisLoopParams.ToArray());
rv.ServerReport.Timeout = -1;
rv.ServerReport.Refresh();
// render the report
string mimeType = string.Empty;
string extention = string.Empty;
string encoding = string.Empty;
string[] streamIds;
Microsoft.Reporting.WebForms.Warning[] warnings = null;
byte[] result = rv.ServerReport.Render(outputFormat, deviceInfo, out mimeType, out encoding, out extention, out streamIds, out warnings);
如果我检查thisLoopParams
,我可以清楚地看到“CustomFieldId”ReportParameter
并且它肯定有一个值,但错误仍然出现。
有任何想法吗?