0) Report
Designer
Introduction
One of the most common types of reports is a master detail report. The following tutorial provides the
most straightforward method for creating this type of a report in Visual Studio 2005. We will be using the
Access NorthWind database as our data source. If you do not have the NorthWind database you can
download it here.
Note: SQL Server 2005 Reporting Services (.rdl) uses a similar method for creating master detail
groupings.
Select Report:
Example:
There are three main ways to create a hierarchical report using grouping. This example will use the
"Master List Detail Table" method. The other two methods are "Master List Detail List" and "Single Table
Master Detail". An alternate method to using groups is to use sub-reports.
Drag a table from the Report Items toolbox section into your master list.
Right-click the top left corner of the table and select Properties.
Set the DataSet name to the NorthwindDataSet_Sales_by_Category table. Some clarification: the
report designer refers to a result set as a "DataSet". This is not the same as a .NET Framework
"DataSet". The report designer's "DataSet" more closely relates to a .NET DataTable.
Select the Groups tab.
Click Details Grouping... Note: In a single table master detail report, you would instead click
"Add...".
Group on each detail column. In this case: ProductName and ProductSales.
Click OK.
Click OK.
Drop the ProductName field into the Detail (middle) row of the first column in the table.
Drop the ProductSales field into the Detail (middle) row of the second column in the table.
Optional: Resize the parent list textboxes, bold the table's column headers, and add another
textbox label for the ID.
Optional: Drag the Product Sales column from the Data Sources into the Detail table's Product
Sales Footer row.
Note: VS automatically inserts the Sum aggregate function which will provide a subtotal of the
Products within the Parent category.
Optional: Prepend some descriptive text ("Total: " in this case) into the summary Footer record and
format the Detail and Footer values as currency.
Detail: = FormatCurrency(Fields!ProductSales.Value)
Footer: = "Total: " & FormatCurrency(Sum(Fields!ProductSales.Value))
5. Create the report form
Conclusion
Please comment on anything that needs further clarification or with any questions on implementing this.
Also, please provide suggestions before rating the article less than a 5.