Avatar of JeffStone
JeffStone
Flag for United States of America asked on

Restart page numbering within list

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

Avatar of undefined
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
chapmandew

check out the new dense_rank() function in 2005:

http://blogs.techrepublic.com.com/datacenter/?p=277
JeffStone

ASKER
I am missing the point of this ... please explain further.
Your help has saved me hundreds of hours of internet surfing.
fblack61
JeffStone

ASKER
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.
ASKER CERTIFIED SOLUTION
JeffStone

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.