Access Page number in report body In SSRS

前端 未结 4 1841
Happy的楠姐
Happy的楠姐 2020-12-03 15:00

I want to use Globals!PageNumber in Report body part. How can I access inside Report body?

I am using SQL Server Reporting Service 2008 R2.

4条回答
  •  有刺的猬
    2020-12-03 15:43

    For that you need to use Report variables:

    Go to Report Menu from main Menu in Visual Studio, > Click on Report Properties > Add new variable - named as PageCount (Default value to 0)

    Then inside header of footer create one textbox and set below expression,

    =Variables!PageCount.SetValue(Variables!PageCount.Value+1)
    

    It will automatically increase for each page.

    NOTE: Do not hide it from header or footer, the SetValue will not work if you hide the box, so change the font of textbox to white color. (Do whatever you want but just do not hide it. Then you can use below expression to fetch pagenumber value inside report body.

    =Variables!PageCount.Value
    

    I have taken reference from this answer.

提交回复
热议问题