Friday, March 23, 2012

Reset PageNumber On Group Change

I need to reset the page number when a group changes. The group is controlled
in a list. PageNumber works well for overall numbering, but not inside the
group, furthermore, I cannot access the current pagenumber from inside the
group.
I am using RS 2005.Add this to your report code:
Shared offset as Integer
Public Function GrpPN(reset As Boolean, pagenumber As Integer) As Integer
If reset
offset = pagenumber - 1
End if
Return pagenumber - offset
End Function
Then place a text box in the page footer with this expression - assuming you
have the group set with page break at end and have labeled your Group cell.
="Page " & Code.GrpPN(Not(ReportItems!txtGroup.Value Is Nothing),
Globals!PageNumber)
Hope that helps (this was in 2000)
--
Allison
"Rick" wrote:
> I need to reset the page number when a group changes. The group is controlled
> in a list. PageNumber works well for overall numbering, but not inside the
> group, furthermore, I cannot access the current pagenumber from inside the
> group.
> I am using RS 2005.

No comments:

Post a Comment