BLOGS BY TOPIC
BLOGS BY AUTHOR
BLOGS BY YEAR
SQL Server Reporting Services 2008 introduced gauges, in all their dazzling compexity. This free tutorial blog shows how to create gauges, format their pointers and scales, add labels and much else besides.
Posted by Andy Brown on 25 July 2011
You need a minimum screen resolution of about 700 pixels width to see our blogs. This is because they contain diagrams and tables which would not be viewable easily on a mobile phone or small laptop. Please use a larger tablet, notebook or desktop computer, or change your screen resolution settings.
The first thing to think about when creating a gauge is which type you want!
Types of Gauge: Radial and Linear
There are two types of gauge:
- Radial gauges look like old-fashioned car speedometers; while
- Linear gauges look like old-fashioned weighing-scale read-outs.
|Radial gauge example||Example of linear gauge|
Creating a Gauge
To create a gauge, drag the relevant control into a report:
Click on the Gauge report item and drag it onto your report.
You can now choose the type of gauge you want:
For our example, we'll use the first type of linear gauge (although we'll subsequently make lots of amendments to it).
Assigning Data to a Gauge
Having created a gauge, you need to tell SSRS what it is measuring:
Click on the gauge, then choose which field it should represent.
You now have a gauge which doesn't look that impressive:
Initially, the scaling set means that we can't see anything
Changing Gauge Scaling
To get the gauge to measure the length of each film meaningfully, we need to change the scaling:
To change the default scaling of a gauge:
You can now fill in options to tell SSRS how to scale film lengths:
Here we've chosen to show a scale from 60 to 240 minutes, with 60 minute intervals.
The result is a gauge which finally shows something meaningful:
The gauge actually measures what it was supposed to now
The next step is to size and position the gauge and its contents, but to do this we need to learn a bit about gauge measurements.