CHAPTER 4 LAYING OUT A REPORT
Listing 4-3. RDL Output for Rectangle
The completed report for the Rectangle object is called Rectangle.rdl and is located in the Pro_SSRS
project.
Implementing a Matrix
You can use the Matrix data region to produce output formatted in rows and columns around
aggregated measures. A Matrix in SSRS is similar to a pivot table or a cross-tab report. You can group
data fields in a Matrix together with other fields, producing a natural summary and detail relationship.
Simple single-level Matrix data regions with one column and one row provide valuable BI that you can
deploy for quick analysis. This is true for data derived from standard SQL queries or from data derived
from an MDX query used with Analysis Services (covered in Chapter 12). For now, we’ll introduce some
of the properties of the Matrix data region and use the stored procedure, Emp_Svc_Cost, to populate it
with the Estimated_Cost value for each patient over a given time. You concatenate the field values for
Year and Month to use for the column grouping section of the Matrix, and Patient_Name for the row
grouping.
The starting point report for the Matrix object, demonstrated in this section, is available in the
Pro_SSRS project in the Source Code/Download area for the book on the Apress site. This report is called
Matrix Start.rdl.
By default, a Matrix data region holds only three cells, defining Columns, Rows, and Data cells, as
shown in Figure 4-20. You can use the fourth blank cell at the top left for a label or for an expression-
and-parameter combination that can control the layout of the Matrix, such as expanding or collapsing
groups interactively—we will demonstrate later.