Exforsys

Home arrow Reviews arrow SQL Server Reporting Services

Report Builder 2.0 - Subreports

Author: Packt Publishing     Published on: 3rd Jun 2009

A subreport is a child of a main report. The main report is a container for the subreport (s). The Subreport section in the Insert menu item of the "ribbon" allows you to add a subreport. The parent report and the subreport are stored usually in the same folder on the report server. The main report can be designed to pass parameters to the subreport. The parameter then filters the subreport for it to be displayed in a data region of the main report. You will be doing a hands-on, where you will be designing a Main Report/Subreport pair to learn about passing parameters in the next chapter.

Ads

Subreports can be separated from main data region of the main report or they can be placed within the data region of the main report. A report can contain more than one subreport.

As described above, the subreport may be placed inside the main report several ways as shown in the following screenshot:

Header and footer

A report page can contain a header and footer. In Report Builder 2.0 there is page footer by default which contains the built-in parameter ExecutionTime.

Some of the common features of page headers and footers are the following:

  • Headers go at the top of the page and footers go to the bottom and they repeat on each page of the report.
  • They both can contain static text, images, lines and rectangles, borders, expressions (lookup the properties of these in Report Builder 2.0).The expressions can include field references for reports from the dataset.
  • You can easily add headers and footers from the Insert menu item in the "ribbon". You can just, as easily, remove them by right-clicking the item and choose to remove the item.
  • The most common use of headers and footers is to display page numbers, report titles, and so on. There are number of built-in fields such as Page Number, Execution Time, Report Name, Total Pages and so on, which can be dragged-and-dropped on to headers and footers.
  • To display variable data from a dataset in headers and footers you place a textbox and set the value for the textbox using an expression. Choose the appropriate field from the dataset. In a similar manner you can display aggregate values from the expression builder. For data from multiple datasets you cannot reference the fields, rather you should reference the objects in the report.
  • You can suppress these on the first and last pages of a report using the PrintOnFirstPage, PrintOnLastPage properties which can be accessed from their properties.
  • Report headers and footer are not the same as the page headers and footers.
  • Reports that you see with a browser are rendered by the HTML renderer, but the report can be delivered in different formats. Each of them has their own renderer and you should optimize the report for the format you want to deliver.

You will be getting some practice adding headers and footers and working with them in the next chapter.

View

The View menu has very few items as shown:

Report Data and Grouping are checked by default. If you want to review or make changes to the properties of objects you place on the report, you should first place a checkmark for the Properties. Otherwise you will see only the Properties pop-up window that comes up when you right-click an object to look at its properties. In Hands-on 6.3, you will be accessing properties for some of the items, such as the bookmark property.

Ads

Place checkmark for the Rulers if you want to design measured placement of objects on the report. The rulers become visible when you move around or adjust object sizes.



 
This tutorial is part of a SQL Server Reporting Services tutorial series. Read it from the beginning and learn yourself.

SQL Server Reporting Services

 

Comments