Pagination and Rendering Enhancements

R2 brings more control over pagination and rendering. A question that pops every now and then on the discussion list is how to name Excel worksheets for each instance of a row group. This scenario wasn’t supported before R2. In R2, there are addition page break options, as shown in the screenshot below. One of them is PageName.

111709_1350_Paginationa1

In this case, I set the PageName property of the ProductCategory row group to the Category field. Then, I set up the BreakLocation of the ProductCategory row group to break when the product category changes. The screenshot below shows what the exported to Excel report looks like. As you can see, each worksheet is now named. If the row group spills on the next page, a new worksheet is added with the same name.

111709_1350_Paginationa2

Another welcome enhancement is the ability to reset page numbering. Suppose you have a master report that includes a subreport and you want to reset the page numbering before the subreport is rendered. This is another commonly requested scenario which wasn’t supported before R2. In the screenshot below, I have a report package that includes two subreports. I want to reset the page number after the first subreport renders. Since the subreport region doesn’t have page break properties, I enclosed the first subreport in a rectangle and set the rectangle PageBreak ð BreakLocation to End and PageBreak ð ResetPageNumber to True. In the page footer, I added Globals!PageNumber of Globals!OverallTotalPages. Since you can reset the page number, the RS team has added also OverallPageNumber and OverallTotalPages built-in fields to the Globals collection. Given this setup, the report will increase the page number for each page in the Company Sales 2008 report. Once Company Sales 2008 has rendered, the server will reset the page number but it will show the overall number of pages.

111709_1350_Paginationa3

Notice that there is also a Disabled page break property. Suppose that when exported to other formats you want your report to break on each row group instance but when exported to Excel you want the entire report to export to a single worksheet. R2 has added two additional built-in fields to the Globals collection, RenderFormat.Name and RenderFormat.IsInteractive, that lets you support such scenarios. In this case, I had to define the following expression for the PageBreak ð Disabled property:

=Iif(Globals!RenderFormat.Name=“EXCEL”, True, False)

If the user exports the report to Excel, the expression turns on the Disabled property and no page breaks are generated. However, if the user exports the report to another format, the report breaks on each instance of the row group.

Finally, to round up the rendering enhancements, you have now the option to rotate text 270 degrees as shown in the report below. This can be easily achieved by setting the textbox WritingMode property to Rotate270. You probably would want to set also TextAlign to Center and VerticalAlign to Middle.

111709_1350_Paginationa4