Pro SQL Server 2012 Reporting Services

(sharon) #1
CHAPTER 4  LAYING OUT A REPORT

Figure 4-3. Preview of the List data region


For the List we added, there is a default (Details) row grouping as evidence in the Row Groups area
of the report. However, no field value is currently assigned as the group; it is simply blank. To add
grouping, click the down arrow on the Row Groups (Details) and select Group Properties. Add two fields
by clicking Add in the Group Expressions area—Patient_Name and then Employee_Name—as group
expressions.
The preview of the new List with grouping levels now shows the correct number of visits for each
patient and employee combination. However, notice that in Figure 4-4 Bill Shakespeare is showing up
multiple times, with 37 visits for employee Bailey McDonald and eight visits for employee Sherri
McDonald, for example. What you really want to see is Bill Shakespeare once with all the employee and
visit information grouped in the figure. You could remove the grouping for the employee from the List,
but that would cause the report to group all the patients’ visits under a single employee and reflect the
data inaccurately. In former versions of SSRS, only a nested List would achieve this level of multiple
groupings and the report developer may have needed to look at using an alternative report object, like a
table—that would have got the level of desired grouping, but would have lost the free-form feel of the
report. Since SSRS 2008, however, the List object includes Tablix properties. In other words, when you
add a List object from the Toolbox onto the design surface, a Tablix is created. The Table and Matrix
objects also share the Tablix Properties are implemented as a Tablix. With Tablix properties, it is possible
to create a parent group above the default Details Group and add the patient name information there, so
the desired fields, Patient_Name and Employee_Name, can now be grouped hierarchically.

Free download pdf