SSRS IIF条件错误

时间:2014-09-02 16:28:28

标签: reporting-services

如果等于1,我试图返回绿色YES,否则返回红色NO。这意味着它等于0.我发现这个我认为有用,但无法弄清楚如何将它拼凑在一起。SSRS - Conditional Text Formatting (Expressions using Switch)

下面给出了一个错误

IIF(Fields!SurveyCompleted.Value = 1, "Green", "Red")

错误4 [rsFieldReferenceAmbiguous]文本框“Textbox12”的值表达式直接指向“SurveyCompleted”字段,而不指定数据集聚合。当报表包含多个数据集时,数据区域外的字段引用必须包含在指定数据集范围的聚合函数中。

我在尝试更改颜色时无意中更改了文本。

=First(IIF(Fields!UniqueReportRequests.Value = 1, "Yes", "No"),"RawCompletionScore")

如何将两者结合使用以更改颜色和文字?颜色表达需要数据集" RawCompletionScore"声明?

1 个答案:

答案 0 :(得分:2)

你在找这个..

=IIF(First(Fields!SurveyCompleted.Value, "RawCompletionScore") = 1, "Green", "Red")

<强>修改:

在你的TextBox上..

enter image description here

单击鼠标右键,然后选择表达式。

输入你的表达..

=IIF(Sum(Fields!UniqueReportRequests.Value, "RawCompletionScore") = 1, "Yes", "No")

在TextBox属性中,设置背景颜色..

enter image description here

=IIF(First(Fields!SurveyCompleted.Value, "RawCompletionScore") = 1, "Green", "Red")