Microsoft SQL Server 2008 R2 810-08230 Benutzerhandbuch
Produktcode
810-08230
172
CHAPTER 9
Reporting Services Enhancements
Pagination Properties
There are three new properties available to manage pagination: Disabled, ResetPageNumber,
and PageName . These properties appear in the Properties window when you select a tablix,
rectangle, or chart in the report body or a group item in the Row Groups or Column Groups
pane. The most common reason you set values for these properties is to define different pag-
ing behaviors based on the rendering format, now that the global variable RenderFormat is
available .
and PageName . These properties appear in the Properties window when you select a tablix,
rectangle, or chart in the report body or a group item in the Row Groups or Column Groups
pane. The most common reason you set values for these properties is to define different pag-
ing behaviors based on the rendering format, now that the global variable RenderFormat is
available .
For example, assume that you create a tablix that summarizes sales data by year, and
group the data with the CalendarYear field as the outermost row group. When you click the
CalendarYear group item in the Row Groups pane, you can access several properties in the
Properties window, as shown in Figure 9-7 . Those properties, however, are not available in the
item’s Group Properties dialog box .
CalendarYear group item in the Row Groups pane, you can access several properties in the
Properties window, as shown in Figure 9-7 . Those properties, however, are not available in the
item’s Group Properties dialog box .
FIGURE 9-7
Pagination properties
Assume also that you want to insert page breaks between each instance of CalendarYear
only when you export the report to Excel . After setting the BreakLocation property to Be-
tween, you set the Disabled property to False when the report renders as Excel by using the
following expression:
tween, you set the Disabled property to False when the report renders as Excel by using the
following expression:
=iif(Globals!RenderFormat.Name="EXCEL",False,True)
Reporting Services keeps as many groups visible on one page as possible and adds a soft
page break to the report where needed to keep the height of the page within the dimen-
sions specified by the InteractiveSize property when the report renders as HTML. However,
when the report renders in any other format, each year appears on a separate page, or on a
separate sheet if the report renders in Excel .
sions specified by the InteractiveSize property when the report renders as HTML. However,
when the report renders in any other format, each year appears on a separate page, or on a
separate sheet if the report renders in Excel .
Whether or not you decide to disable the page break, you can choose the conditions to
apply to reset the page number when the page break occurs by assigning an expression to
the ResetPageNumber property . To continue with the current example, you can use a similar
conditional expression for the ResetPageNumber property to prevent the page number from
resetting when the report renders as HTML and only allow the reset to occur in all other
formats . Therefore, in HTML format, the page number of the report increments by one as you
page through it, but in other formats (excluding Excel), you see the page number reset each
time a new page is generated for a new year .
the ResetPageNumber property . To continue with the current example, you can use a similar
conditional expression for the ResetPageNumber property to prevent the page number from
resetting when the report renders as HTML and only allow the reset to occur in all other
formats . Therefore, in HTML format, the page number of the report increments by one as you
page through it, but in other formats (excluding Excel), you see the page number reset each
time a new page is generated for a new year .