Pro SQL Server 2012 Reporting Services

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

Table: This is used for tabular reports with rows and columns, but provides
single or multiple date groups.

Rectangle: Like the List, the Rectangle is a container, although it provides no
data groupings.

Matrix: This report object, like the Table, provides multiple grouping levels, but
lays data out as a cross-tab or pivot-style report.

In SSRS for 2008, Microsoft introduced the Tablix control, which at its core is a conglomeration of
row-level grouping and column-level grouping. Before SSRS 2008, it was difficult to create a report that
combined these two levels of grouping. You can use the Tablix properties in three controls, List, Matrix,
and Table, creating on-the-fly column or row groups at any level within the three report objects. RDL
code for Tablix support has been added as well, as you will see as we go through the report objects that
support Tablix properties. In Chapter 6, you will see more detail on adding Tablix properties to a report.


Implementing a List

The List data region is one of the two free-form container objects that allow grouping of data, the other
being Rectangle. The two objects are similar in that they can contain other report objects and data
regions. Free-form data regions don’t constrain the layout of fields to a fixed format; the person creating
the report is responsible for aligning the objects.
Because the List contains a grouping level, you can use the List data region only with a single
dataset. Note that the List data region displays one record at a time from the dataset based on this
grouping. By default, no grouping is assigned to a list.
To learn how you can use the List data region with the Emp_Svc_Cost stored procedure, which
returns detail records for the number of visits for patients, you will add a List to the design area and drag
fields from the dataset into it. You will use Employee_Name, Patient_Name, Visit_Count, and
Estimated_Cost to show total visits and cost for each patient/employee combination.
In the Pro_SSRS solution, the list sample’s starting-point report is called List Start. This report has a
data source and dataset, called emp_svc_cost, already defined for the localhost server, which should
match your environment if you are using BIDS to connect to your local SQL Server.
To begin, open the List Start report, and click the Layout tab. Before we get started on creating the
report, click on Report ➤ View ➤ Ruler to make the ruler visible on the designer. Next, add the List report
object to the report by double-clicking the List object in the Toolbox. The List control is automatically
added to the upper-left area of the design grid. Grab the lower-right corner of the List and drag it down
until it is approximately 7 inches wide by 1 inch in height.
Next, select the Datasets in the Report Data toolbar, expand the emp_svc_cost dataset, drag the fields
in the following list to the design area, and place them in the List data region:



  • Patient_Name

  • Employee_Name

  • Service_Type

  • Estimated_Cost

  • Visit_Count

Free download pdf