0

How to use expression in the indicator tool in SSRS to choose the start point and end point. Suppose I have person table with person_id and in my report I need to show the person_id column and indicator based on the person_id.

For example for person_id from 0 - 10 I need to show red, 10 - 20 as Green. Instead of hardcoding the value i need to use the expression. I tried the following expression as

In start expression =Fields!person_id.Value>0 and End expression =Fields!person_id.Value<10.

Again for the second set.

In start expression =Fields!person_id.Value>10 and End expression =Fields!person_id.Value<20

but all the time i am getting the same color in my report.

4

2 回答 2

3

假设您有这样的数据:

在此处输入图像描述

以及基于此数据集的最简单的报告:

在此处输入图像描述

我使用以下表达式设置了详细文本框的BackgroundColor属性:

=Switch(Fields!person_id.Value >= 0 and Fields!person_id.Value < 10, "Red"
    , Fields!person_id.Value >= 10 and Fields!person_id.Value < 20, "Green"
    , true, Nothing)

这对我来说很好:

在此处输入图像描述

于 2013-09-13T11:57:20.507 回答
1

将指标拖到要显示的相应字段,转到指标的属性,然后转到指标属性选项卡中的值和状态。他们只需要给出相应颜色的起始值和结束值。

于 2013-09-17T10:05:18.527 回答