The Result Data Newsletter   
Volume 710 - October 2007   
© Copyright 2007 Result Data Consulting, Ltd.  614-505-0770  www.resultdata.com   

    Result Data Home Page  |  Newsletter Archive  |  Upcoming Events  |  Classes & Workshops  |  Request Information
Upcoming Events:  Mid Ohio BusinessObjects User Group: 11/14, Data to Dashboards: 11/14, Microsoft Data Mgt & BI Seminar:  12/14, Microsoft SQL Server User Group:  12/14

Return to Newsletter Contents...

 

Using Container Controls Inside Container Controls In A Reporting Services Report

by: Charles Tournear, Sr. Consultant, MCT, MCSE, MCSD, MCDBA, CRCP

SQL Server 2005 Reporting Services Reports supports three types of container controls: List, Matrix, and Table.  For most reports we are use to using the wizard concept where we select a single container for the report depending on the type of report format we need.  Use a table if a spreadsheet format is needed.  Use a matrix if a cross-tab format is needed.  Use a List control if a form layout format is needed.

There are some advantages to using one container type inside another, such as better control of the report layout. There are also some potential issues if the containers aren’t placed within each other correctly.  In this article we are going to focus on just the List control and the Table control.

Let’s first look at the table control as the base of the report.  The table control supports multiple grouping.  We want multiple fields to appear together in a single cell, such as name, address, city, state, and zip.  One method would be to use a complex expression that adds the fields together separated by char(13) + char(10) to put the fields on different lines.

Another method is to put a list box inside the cell and then place other controls such as images or textboxes within it.

In the example below the first table has had a grouping added to the group by invoice_id.  In the first row, first cell a list box has been added which contains two textbox controls.  This first row is the table header and if the table is the base control this section only appears at the beginning of the report.  By putting the list control in the header, the list box is going to display all of the invoice addresses at the beginning of the report, followed by the grouping information.  This is not what we want.  We want the address to appear once for each invoice.

The second row is an example of a list box placed inside the group header.  Since the group header only appears once for each group, the list box is automatically filtered for the group and display’s only the address for the current invoice_id.

Pic 1

So be careful where you place a list box if the table control is the base control.

If another list control or table control is placed inside the list box inside the table you will receive the following error when selecting preview.

Pic 2

A list control must have a grouping defined in order to put another container control within it.

For an invoice the reverse of the above would be a better scenario.  Use a large list box as the base of the report and set the grouping property of the list box control by right clicking the control and selecting properties.

Pic 3

In the properties window on the General tab select the Data set name that the control is to use and select the Edit details group.

Pic 4

Set the Expression on the Grouping and Sorting General tab to the field that you want to group by.

Any control that you place inside the list box control will now be filtered by the grouping value, including table controls.  We don’t have to configure the tables grouping properties unless we want to add a new grouping within the table.  This allows you to have multiple table controls on the same invoice, along with additional text box controls all filtered for a specific invoice.

Now what if we put a list control in the header section of the table control in the list control?  We will again have the entire list appear for the header.  However if we set the grouping of the new list control to match the outer list control, it will be filtered again and only display information for the current invoice.

So consider your options for placing different container controls within each other to provide greater flexibility in your reports without having to create sub-reports and link them with parameters.

Go to Top  |  Return to Newsletter Contents

The Result Data Newsletter is published approximately once a month to share the latest information on business intelligence, data management and CRM. There should be a link below to allow you to change or remove yourself from our list. We take your requests very seriously. If you have any difficulty please contact us at 614-505-0770 and we will make sure that your request is handled properly. This is not intended to be an unsolicited message and you can reach us in person if needed.

© Copyright 2007 Result Data Consulting, Ltd. - All Rights Reserved
All trademarks and copyrights are the property of their respective owners. This information is provided without warranty.
Announcements
Fall Training Special
Get a jump on your Christmas shopping!  Schedule and attend any public training class now through December and receive a FREE $50 gift card to Target, Barnes & Nobles or Best Buy (restrictions apply).  Call 614-505-0770 for further details and restrictions.
Next MOBOUG Meeting
The next Mid-Ohio Business Objects User Group (MOBOUG) meeting is November 14, 2007.  Call 614-505-0770 or click here to reserve your seat.
Data to Dashboards
Join us on November 14th to learn about the methods and tools that can transform your data into highly functional and robust dashboards, reports and analytics.  Data-to-Dashboards will provide an overview as well as live demonstrations of the complete process that collects, transforms and delivers your data using industry leading Business Intelligence software.  Enjoy a comprehensive review of the concepts and tools that deliver top quality BI content to your user community.  Call 614-505-0770 or click here to reserve your seat.
Looking for a Few Good Men and Women
Join our award winning team of Business Intelligence consultants and .Net Software developers.
Send your resume and salary requirements to:
jobs@resultdata.com
Next Microsoft Data Management & BI Seminar
The next free Microsoft BI seminar is on Dec. 14, 2007.  Call 614-505-0770 or click here to reserve your seat.
Next Microsoft SQL Server User Group
The next free Microsoft User Group is on Dec. 14, 2007.  Call 614-505-0770 or click here to reserve your seat.