我正在使用C#渲染SRSS 2008 R2的報告 報告有參數,很長一段時間我沒有任何問題渲染輸出。但是今天它已經決定不去上班了!C#Report 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
,它肯定有一個值,但該錯誤仍然出現。
任何想法?
嘗試打開rdl併爲該參數添加默認值。 – Igoy
完成。悲傷地仍然得到相同的錯誤 – zXynK