Hello,
I need to reset page no on report when the group changes. I tried using page reset property but it doesn't work. So I'm doing to through code.
REM Reset Page Number:
Shared offset As Integer
Shared newPage As Object
Shared currentgroup1 As Object
Shared currentgroup2 As Object
Public Function GetGroupPageNumber(ByVal NewPage As Boolean, ByVal pagenumber As Integer) As Object
If NewPage Then
offset = pagenumber - 1
End If
Return pagenumber - offset
End Function
Public Function IsNewPage(ByVal group1 As Object, ByVal group2 As Object) As Boolean
newPage = False
If Not (group1 = currentgroup1) Then
newPage = True
currentgroup1 = group1
currentgroup2 = group2
Else
If Not (group2 = currentgroup2) Then
newPage = True
currentgroup2 = group2
End If
End If
Return newPage
End Function
Kindly suggest. This is not giving correct page nos.
Then in hidden textbox, my expression is
=Code.IsNewPage(Fields!Sales_Invoice_Header__Sales_Invoice_Header___No__.Value,Fields!OutputNo.Value)
In footer, it is
Code.GetGroupPageNumber(ReportItems!NewPage.Value,Globals!PageNumber)