Conditionally Hide SSRS Gauge Pointer

zephyr_hex (Megan)
zephyr_hex (Megan) used Ask the Experts™
on
I built a gauge in SSRS and added 3 pointers.  Each pointer is based on a product's manufacturing group.

So, for example, there's a white pointer with an expression as the value:
=IIF(Fields!Manufacturing_Group.Value = "White", Fields!Total_Labor_Hours.Value, 0)

Open in new window


And a blue pointer:
=IIF(Fields!Manufacturing_Group.Value = "Blue", Fields!Total_Labor_Hours.Value, 0)

Open in new window


And a brown pointer:
=IIF(Fields!Manufacturing_Group.Value = "Brown", Fields!Total_Labor_Hours.Value, 0)

Open in new window


I don't want to see a pointer if the value is zero.  How can I conditionally hide a pointer?

gauge
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2010

Author

Commented:
I have a semi-solution.  It doesn't hide the gauge pointer, but it does make the pointer appear to be disabled:

disabled pointers

The way I achieved this was to change the Pointer Fill Color (and Secondary Color) to an Expression:
=IIF(Fields!Manufacturing_Group.Value = "Blue" AND Fields!Total_Labor_Hours.Value > 0,"CornflowerBlue",Nothing)

Open in new window


NOTE:  It wouldn't work if I did the reverse check:

=IIF(Fields!Manufacturing_Group.Value = "Blue" AND Fields!Total_Labor_Hours.Value = 0,Nothing,"CornflowerBlue")

I'll leave this question open in case someone comes up with a better solution.
Setting the 'Width (percent)' property to 0 hides the Pointer. For example for the White pointer you can use this expression for the Width property:
=IIF(Fields!Manufacturing_Group.Value = "White", 15, 0)

Open in new window

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial