Rendering Considerations for Automatic Sizing and Positioning

New: 17 July 2006

In Report Designer, when you add report items from the Toolbox in Layout view, certain rules apply to the way these report items are rendered after a report is processed. The table, matrix, list, and chart table regions dynamically expand to accommodate data retrieved from the data source in the associated report datasets. When report items are placed next to each other in a report layout, several properties determine how these report items are rendered. This topic explains the automatic sizing and positioning behavior.

Automatic Position and Size Behavior of Report Items

The following table lists the main report definition elements and the properties that influence how an item renders on a page.

Report Element Notes

Report Body

The root container. Sizing properties: Size, Width and Size, Height.

The dotted white background that appears in the Layout view represents the report body. To remove unwanted white space, reduce the extra white background.

Report Page

For reports sent to renderers that support physical pages, properties include:

PageWidth

PageHeight

LeftMargin

RightMargin

TopMargin

BottomMargin

Text box

Sizing Properties: CanGrow, CanShrink

Can adjust vertically. Automatic horizontal growth is not supported.

Table

The number of rows can grow to accommodate the associated dataset. Creating groups also influences the number of rows in the table.

Matrix

The number of columns and rows can grow to accommodate the associated dataset. Creating groups also influences the number of columns and rows in the matrix.

List

The number of instances of report items grows to accommodate the associated dataset. Report items can be placed in lists to create a free-form layout. Report items in the same list are peers. Lists can be nested to create parent-child relationships.

Rectangle

Acts as a container. When you place multiple items in a rectangle, they are peers to each other. Rectangles can be nested to create parent-child container relationships. Rectangles grow to accommodate the dynamic elements in a data region.

Subreport

Properties on the parent container are ignored. Properties such as Size, Width and Size, and Height are taken from the subreport's report definition. A subreport report item in a parent container grows to accommodate the subreport.

The parent container of the subreport needs to be the same width or smaller than the subreport's report width to eliminate white space.

Report items grow to accommodate the contents mapped from the associated dataset, expression, subreport, or text. The way report items are rendered is defined by the renderer used to view the report. For more information about specific renderers, see Design Considerations for Report Rendering.

When you first position an item on the report page, the distance between the item and all items that begin to the right of it becomes the minimum distance that must be maintained as a report item grows horizontally.

Similarly, the distance between an item and the item above it becomes a minimum distance that must be maintained as the top item grows vertically.

An item in a report grows to accommodate its data and pushes peer items (items within the same parent container) out of the way using the following rules:

  1. Each item moves down to maintain the minimum space between itself and the items that end above it.
  2. Each item moves right to maintain the minimum space between itself and the items that end to the left of it. For systems that right-to-left layouts, each item moves left to maintain the minimum space between itself and the items that end to the right of it.

Containers expand to accommodate the growth of child items.

The combination of this behavior, the width and height properties of report items, the size of the report body, the page height and page width definition, the margin settings of the parent report, and the renderer-specific support for paging all combine to determine what report items fit together on a page.

Report Definition Properties that Control How Report Items Are Positioned on a Page

The report definition language provides properties to control how items that are placed next to each other are rendered. Space on the page will be reserved for items that have the Hidden or ToggleItem property set to an expression. The KeepTogether property on a data region attempts to keep together the header, the group header, and the details, if possible.

Report Designer RDL Element Property

Report Properties

Report

Width

PageHeight (only for physical page renderers)

PageWidth (only for physical page renderers)

InteractiveHeight (Default height for interactive renderer; 0 is unlimited)

InteractiveWidth (Default width for interactive renderer; 0 is unlimited)

LeftMargin

RightMargin

TopMargin

BottomMargin

Properties window

ReportItem (DataRegion, Textbox, Subreport, Line, Rectangle, Image, CustomReportItem)

Top

Left

Height

Width

RepeatWith<dataregion> (not supported for data regions, subreports, or a rectangle that contains a data region or subreport; not supported in page headers or page footers)

Property pages on the data region

DataRegion (Table, Matrix, List, Chart)

KeepTogether

PageBreakAtStart

PageBreakAtEnd

Group property pages on the data region

Grouping

PageBreakAtStart

PageBreakAtEnd

Textbox property

Visibility tab on property pages

Visibility property

A report item that has the Hidden property value set to True (a constant) is treated as if it is not there for rendering purposes. When Hidden is set to an expression or when there is a ToggleItem set, the layout accommodates the report item to make space for it.

See Also

Concepts

Design Considerations for Report Rendering
Designing the Report Layout
Adding a Page Header and Footer to a Report
Hiding Report Items

Other Resources

Report Definition Language
Report Properties (Layout Tab, Report Designer)

Help and Information

Getting SQL Server 2005 Assistance