views:

829

answers:

4

Hi Is there any way to get total pages in ssrs report body? I tried different metods but could not get page number in the report body

A: 

I used Global.TotalPages but I get this error "The Value expression for the textbox "textbox1" refers to the global variable PageNumber or TotalPages. These global variables can be used only in the page header and page footer.

Build complete -- 1 errors, 0 warnings". I would be grateful if someone could tell me how to use this global variable in the body of a report

A: 

I tried this and unfortunately the returned value of GetTotalPages is always 1

A: 

Can someone help me to solve the problem?

Ciprian
+1  A: 

I don't think it is possible to do what you are asking - the Globals!TotalPages value is only available once the report body has finished rendering, until then the server will not know the total number of pages in the report - this is why an error is generated when you try and reference TotalPages in the report body. You will only be able to use this value in the header or footer.

Nathan