CHAPTER 6 BUILDING REPORTS
When you preview the report and select multiple years, as in Figure 6-38 where years 2009 and 2010
and all months are selected, you can see the column groupings automatically expand horizontally and
group the values accordingly. For example, there are 75 Home Health Aide visits in 2009 for Congestive
Heart Failure and only 16 visits in 2010 for the months selected.
Figure 6-38. Preview of Employee Service Cost report with column groupings
Configuring Report and Group Variables
SSRS has implemented global variables since its initial release in SQL 2000. These variables, such as
ExecutionTime and UserID, can be used in reports. For example, the expression
=Globals!ExecutionTime returns the time at which the report was executed. This value, unlike that
returned by the expression Now(), does not change after the report is rendered, so paging through the
report will not change the value of the global variable.
SSRS 2008 introduced two new types of variables—report variables and group variables— that can
be configured at design or runtime to be static throughout report execution and viewing. You will use a
report variable in this section to create a threshold for the Visit_Count field so that when the report is
run, you can calculate whether the number of visits have met the report variable threshold. You will use
the same variable again in the new SSRS Gauge control.
To configure a report variable, go into design mode, click Report Properties under the Report menu,
and then select the Variables tab. You will need to add the report variable as in Figure 6-39. The