I have a list and inside the list is a number of subreports. Is there a way to restart numbering at the start of each new list item / subreport grouping?
DB Reporting ToolsMicrosoft SQL Server 2005
Last Comment
JeffStone
8/22/2022 - Mon
JeffStone
ASKER
A little more info ... I have added a group on a field but am not given the opportunity to add a group header / footer
ok, I have found something else in further googling ...
a) if I set a hidden textbox in the list with the grouping field named HiddenStoreID
b) and then I can put this in the code page
Shared gPageNo as Integer = 0
Shared gCurStore as String = "00000"
Shared gFirstCall as Integer = 0
Function IncPage(ByVal CurStore as String) as Integer
If gFirstCall = 0 Then
gFirstCall = 1
gPageNo = -1
Else
If CurStore = gCurStore Then
gPageNo = gPageNo + 1
Else
gCurStore = CurStore
gPageNo = 1
End if
End If
Return gPageNo
End Function
c) put this in the footer of the wrapper report
="Page: " & Code.IncPage(First(ReportItems!HiddenStoreID.Value))
This works good except for the first report when exporting to PDF where the initial page number is wrong. Anyone have any thoughts.