Published on

January 16, 2025

Controlling Pages and Page Breaks in SQL Server Reporting Services

When working with SQL Server Reporting Services (SSRS), managing pages and page breaks can be a challenging task. In this article, we will explore different methods to control and appropriately set pages and page breaks in SSRS.

Soft Page Breaks

Soft page breaks are used for outputs that are generally displayed on a screen, such as the SSRS preview, HTML, and MHTML formats. These formats utilize scroll bars instead of inserting vertical page breaks. Soft page breaks have the following characteristics:

  • Inserted, explicit, or forced page breaks are honored
  • Margins are not applied
  • Report sizes can adjust to include orphaned and oversize objects

Surprisingly, the Excel and Word render formats also fall within the soft render category.

Hard Page Breaks

Hard page breaks are used for formats that are more centered around physical page outputs, such as PDF, image, and print formats. Hard page breaks put breaks at specific vertical and horizontal points of the report. Hard page breaks have the following characteristics:

  • Pages move left to right and then top to bottom
  • Inserted, explicit, or forced page breaks are honored
  • Items that are set to keep together may still be pushed to a next page if not enough space exists

Page Settings and Page Breaks

Page breaks in SSRS are dictated by the render format used to display the report. The render formats are divided into two categories: soft page-break renderers and hard page-break renderers. The soft page-break renderers include outputs that are generally displayed on a screen, while the hard page-break renderers are more focused on physical page outputs.

At the highest level, page breaks are controlled by two report properties: InteractiveSize and PageSize. The InteractiveSize property controls the size of the soft page-break render formats, while the PageSize property is used for hard page-break render formats.

Page Numbering Options

In addition to controlling page breaks, SSRS also provides options for setting and resetting page numbers and page names. There are four global page number fields that can be added to a report page header or footer:

  • Page Number: Current page number, which can be reset by group and object properties
  • Total Pages: Total pages within the group or object, affected by the reset page number property
  • Overall Page Number: Page number irrespective of the reset page number properties
  • Overall Total Pages: Total pages irrespective of the reset page number properties

Furthermore, the PageName property can be set to display a custom page name on the report. This property is particularly useful when exporting to Excel, as it names each individual tab for each page break.

Conclusion

When designing reports in SSRS, it is important to carefully consider and test the placement of page breaks. The ultimate render format needed for the report should also be taken into account. SSRS offers soft page breaks for screen-based outputs and hard page breaks for physical printing of reports. Additionally, page numbering options can be used to display page numbers and total pages within groups or tablixes. The PageName property is a useful feature when exporting to Excel, as it names each tab for an exported report.

Click to rate this post!
[Total: 0 Average: 0]

Let's work together

Send us a message or book free introductory meeting with us using button below.