Defining Page Size and Page Breaks in a Report (Visual Studio Report Designer)

You can control page size and page breaks by specifying page-related properties in the report definition. The type of control that you are using and the export format used to view a report can affect pagination. The same report will paginate differently depending on how it is viewed. The following list summarizes pagination behavior for different scenarios:

  • The Windows Forms control presents a report in Graphical Device Instrumentation (GDI) format by default. This output format uses soft page breaks (or logical page breaks) that are calculated at run time.

  • The Web server controls presents a report in HTML format, which uses soft page breaks (or logical page breaks) that are calculated at run time. HTML pages are calculated based on the number of rows and columns that are returned for the report.

  • The Excel output format uses soft page breaks (or logical page breaks) that are calculated at run time. Excel pages calculate as worksheets in the same workbook. If a workbook contains four worksheets, each worksheet is considered a single page.

  • PDF and Image rendering extensions are page-oriented formats. As a result, you can set properties to precisely control how pages will break for reports viewed in PDF or Image (TIFF) formats.

The HTML and Excel output formats are not oriented to physical pages. Furthermore, the HTML reports can be interactive, meaning that user actions in a report can trigger additional processing that causes a report to expand horizontally or vertically to accommodate additional content. You cannot precisely control how reports viewed in this format will paginate if the report contains interactive features.

Using Page Breaks to Improve Report Processing Performance

You can improve the performance of large reports during rendering and viewing by using page breaks. Depending on how the report is viewed and whether the control is configured for asynchronous processing, the control will display report page in the viewer while the rest of the pages are rendered in the background. This allows a user to begin viewing the initial pages of the report while waiting for additional pages to become available.

HTML and Excel output shows a report as a single page if there are no page breaks. If you do specify InteractiveHeight and InteractiveWidth, the HTML and Excel output formats render reports using soft page breaks. Soft page breaks are placed on a page using an estimated page size, which makes the size of the reports less exact than reports produced by an output format that supports page size. Soft page breaks are calculated at run time by the control. Although it is not recommended, you can disable soft page breaks by setting InteractiveHeight to 0.

Specifying Page Breaks and Page Sizes

Page breaks determine how content is fitted to a report page. You can set page breaks to occur before or after report items by setting properties on those items.

You can add page breaks at the beginning or the end of a rectangle, table, matrix, list, chart, or group. By default, report items do not have page breaks. To add a page break to the beginning or end of an item, change the PageBreakAtEnd or PageBreakAtStart property for the item.

Page breaks also occur automatically for page-oriented rendering extensions (such as PDF and Image) that enforce a uniform page size across the entire report. The following properties are used to specify page breaks based on page size:

  • PageHeight and PageWidth properties are used by the PDF and Image rendering extensions to establish the regular occurrence of page breaks based on a physical measurement.

  • InteractiveHeight and InteractiveWidth are used by the HTML rendering extension to provide the equivalent of PageHeight and PageWidth. Because the HTML output format dynamically resizes a report to accommodate drilldown, drillthrough, and show/hide features, the report server uses different properties to support pagination on dynamic pages.

Note

The width of a report can be greater than the width of the page. If a report that is wider than the specified page size is rendered by a rendering extension that supports page size, the resulting report may flow horizontally across multiple pages. If you have designed a report to be one page wide, but it renders across multiple pages, check that the width of the report is not larger than the page width.

For more information about setting page size and page breaks, see How to: Set Page Breaks (Visual Studio Report Designer).

See Also

Concepts

Configuring ReportViewer for Asynchronous Rendering
Adding Page Headers and Page Footers to a Report (Visual Studio Report Designer)