Traffic lights in Reporting services

Published 05 May 11 07:07 PM | MartinCroft

Day 5 Pretty easy thing to setup, but can look very effective in a report, you can use gauges but I wanted fore some Health check reports to go for the old traffic light system. To help the Management at work to easily digest if their SQL servers are Critical (Red) Nearly there (Amber) or running ok (Green)

First things first you need some traffic light images, preferably one with a red light on and a green one, etc I think you get the idea. (a link to the ones I used at bottom of the post)

First in a new report we need to add the images we want going to use. Right click and select Add Image


browse to the location of the images held on your computer and add them in one by one.


Here I have loaded 6 images as described above. I have called them the same as the colour of the traffic light to aid clarity.

Add a table into the report design pane and drag in the red image, into the first column. The image properties box will open up as shown below.


Click on the expression button next to use this image and paste in the following code


In the query from the database I am passing through the colour of the Alert in the Value column, so Red, Green or Amber. Which ever one it is, the image for that colours is displayed simple!

So you then get the following based on the values passed in.


you can also expand on this with smaller images to give an instant view of what failed using the same principle.



The images used can be accessed from here


No Comments