dinsdag 24 september 2013

Crystal Reports vs. SS RS / Report Builder: Resetting page number per group and overall total page number

Crystal Reports 2011
In Crystal Reports it is quite easy to reset the page number for every new group. We can do this by using the Section Expert:


























Presenting the page number and the total page number per group is now quite easy. We could do so by using for instance a formula consisting of special fields:

PageNumber & " "& TotalPageCount

But we'll have a problem when we want to add the overall total pagenumber. Crystal Reports does not have an overal total pagecount special field. The only way to solve this problem - to my knowledge - is using a combination of a subreport and a shared variable.

Report Builder / SS Reporting Services
In Report Builder we can use the Built-in Fields for solving this problem.


























When we want the page numbers per group, we use PageNumber and TotalPages; when we want the overall numbers, you use OverallPageNumber and OverallTotalPages.

Member
Description
PageNumber
The current page number relative to page breaks that reset the page number. At the beginning of report processing, the initial value is set to 1. The page number increments for each rendered page.
To number pages within page breaks for a rectangle, a data region, a data region group, or a map, on the PageBreak property, set the ResetPageNumber property to True. Not supported on tablix column hierarchy groups.
PageNumber can only be used in an expression in a page header or page footer.
TotalPages
The total number of pages relative to page breaks that reset PageNumber. If no page breaks are set, this value is the same as OverallTotalPages.
TotalPages can only be used in an expression in a page header or page footer.
OverallPageNumber
The page number of the current page for the entire report. This value is not affected by ResetPageNumber.
OverallPageNumber can only be used in an expression in a page header or page footer.
OverallTotalPages
The total number pages for the entire report. This value is not affected by ResetPageNumber.
OverallTotalPages can only be used in an expression in a page header or page footer.




Een reactie posten