Link to home
Start Free TrialLog in
Avatar of JeffStone
JeffStoneFlag 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?
Avatar of JeffStone
JeffStone
Flag of United States of America image

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
Avatar of chapmandew
check out the new dense_rank() function in 2005:

http://blogs.techrepublic.com.com/datacenter/?p=277
I am missing the point of this ... please explain further.
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
Avatar of JeffStone
JeffStone
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial