user1651283
user1651283

Reputation: 23

index table in the footer of SSRS

I'm building an SSRS report and I wanna an index table to show the page index for each group done by a table, in the footer of the report because i have a lot of pages in my report,but SSRS 2008 doesn't allow to access the page number in the body section in order to pass it to the footer.

Upvotes: 2

Views: 1003

Answers (1)

jozef
jozef

Reputation: 335

you can get that by code.First add a textbox that contain the group title to be indexd,then go to Report-->Report Properties-->code and add this code :

Dim groupNo As Integer = 1 Dim sw As System.IO.StreamWriter Dim max As Integer = 0 Dim text As String = ""

Public Function GetGroupPageNumber(ByVal groupName As String, ByVal pagenumber As Integer) As Object

    If Not String.IsNullOrEmpty(groupName) Then

        text += groupName
        max = groupName.Length

        While (max < 50)
            text += " "
            max += 1
        End While

        Dim index As Integer
        For index = 0 To 20
            text += " "
        Next index

        text += pagenumber.ToString() & vbCrLf

    End If

    Return text

End Function

in the footer section add the textbox that will show the index table and execute the code and pass to it the report title and the page number : Code.GetGroupPageNumber(ReportItems!ReportTitle.Value,Globals!PageNumber)

Upvotes: 1

Related Questions