简体   繁体   English

如何在SRS报告中为字符串值设置指标?

[英]How to set indicators for a string value in ssrs report?

i have SSRS report. 我有SSRS报告。 Here i have an column named "Confirmed", if the value of this column is "Confirmed" then indicator will show green light. 在这里,我有一个名为“已确认”的列,如果此列的值为“已确认”,则指示器将显示绿灯。 But i cannot set the condition for string value in Indicator's expression. 但是我无法在指标的表达式中设置字符串值的条件。 How can i do it. 我该怎么做。 Please help me. 请帮我。

Indicators can only use numerical values, but there's a couple of methods you can still use. 指标只能使用数值,但仍有两种方法可以使用。

One would be to make a confirmed_number column in your dataset by using CASE or DECODE : 一种方法是使用CASEDECODE在您的数据集中创建一个confirmed_number列:

Decode(confirmed, "Confirmed", 1, 0) AS confirmed_number

Another would be to decode the existing confirmed column in the Value parameter of your Indicator: 另一种方法是对指标的“值”参数中的现有confirmed列进行解码:

=IIF(Fields!CONFIRMED.Value = "Confirmed", 1, 0)

Either way you have a numerical value that the Indicator can use. 无论哪种方式,您都有一个指标可以使用的数值。 Set the States Measurement Unit to Numeric, and set the Start and End values of your green icon to 1. 将状态States Measurement Unit设置为数字,并将绿色图标的StartEnd值设置为1。


If you want an alternative to using the indicator, you can set the BackgroundColor of a text box based on your confirmed text like in Marco's comment: 如果您想要使用指示器以外的其他方法,则可以基于confirmed文本来设置文本框的BackgroundColor ,例如Marco的注释:

=IIF(Me.Value = "Confirmed", "Green", "Red")

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM