SRSS 2008 R2的C#报告渲染器-缺少参数

SRSS 2008 R2的C#报告渲染器-缺少参数,c#,ssrs-2008,C#,Ssrs 2008,我正在使用C#呈现来自SRSS2008R2的报告 该报告有参数,很长一段时间以来,我在呈现输出时没有遇到任何问题。然而,今天它已经决定它不工作了 这里是错误 ReportServerException:此报表需要报表参数“CustomFieldId”的默认值或用户定义值。要运行或订阅此报告,必须提供参数值。(rsReportParameterValueNotSet):堆栈:位于Microsoft.Reporting.WebForms.ServerReportSoapProxy.OnSoapExc

我正在使用C#呈现来自SRSS2008R2的报告 该报告有参数,很长一段时间以来,我在呈现输出时没有遇到任何问题。然而,今天它已经决定它不工作了

这里是错误

ReportServerException:此报表需要报表参数“CustomFieldId”的默认值或用户定义值。要运行或订阅此报告,必须提供参数值。(rsReportParameterValueNotSet):堆栈:位于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
,它肯定有一个值,但错误仍然出现

有什么想法吗?

找到了。 我查看了
reportParameterInfo收集paramInfo=rv.ServerReport.GetParameters()并发现某些参数“无效”。我知道为什么,但我有点被最初的“未提供”错误所抛弃。我猜这是因为我提供的箱子我们打折了


谢谢


当我传递'XYZ'字段的值时,我面临着同样的问题,但它说

此报表需要报表的默认值或用户定义的值 参数


当我看到'XYZ'的值时,它有额外的启动空间。当我删除此空间时,它意外地开始工作。我不知道原因,但它可以工作。希望它可以帮助您。

尝试打开rdl并为该参数添加默认值。完成。仍然得到同样的错误,Sadly我使用这种方法来探索我提供的参数;在我的例子中,我提交的GUID参数都是大写的,但有效值是小写的等效值。