The Hardest Thing To Do in SSRS

The Hardest Thing To Do in SSRS… Show your Page Number in the Body.

For example doing a hide/show IF Page Number is 1…

SSRS Renders Header/Footer and Body differently.

Why is it so darn hard! :slight_smile: Crystal Reports could do it :stuck_out_tongue:


I agree and sadly SSRS is not Crystal. Why didn’t MS buy it when they had the chance.

There are so many things in SSRS that are a PITA to do compared to Crystal.

1 Like

I do like the fact that PageNumber and TotalPages can ONLY be used in the report header and footer. Mr G mentions one of the ways around this is to use the code block in the report and create some functions that you can then calculate the values.

1 Like

You can access it via an expression.

1 Like

The “three formula trick” doesn’t work !!!

Well, to be honest, it’s called a “trick” because it was a workaround itself. But it was so easy to use.


But really, the hardest thing to do in SSRS, is to select a subreport or filed, that was set to 1 pt high, placed in a tablix row that is also 1 pt high. Why isn’t there an object explorer?


Oh yeah bring on BOBs for all your Crystal advice.

I feel like I have stumbled upon some Epicor Code in the code section where they are tapping into the header for the page number but I can’t recall which report it was.

It always shows 1 :slight_smile: or nothing…

MICR but again that one is all done in the footer.

Some said it worked up to SSRS 2016 and stopped.

What is this “three formula trick”?

This has worked for me in the past. You can write a custom code function to reference in the body

Function PageNumber() As String
    Return Me.Report.Globals!PageNumber
End Function

Function TotalPages() As String
    Return Me.Report.Globals!TotalPages
End Function

In your expression just write


This was an old trick/hack used in Crystal for calculations as well as passing values in and out of subreports.

Someone can correct me, but i think it just consisted of setting/declaring a variable typical in a group header, then a section below or in your details you would sum that value and display it. Then in a section after you would set the value back to zero.

You can do this with SSRS Custom code sorta. but not for passing values back from subreports to the main

Pretty much correct on the three-formula trick explanation. Easiest way to think of it is three formulas that all reference the same global variable:

  • One formula initializes the value (usually to zero or 1) This is typically in a group header, or just before a group.
  • The second increments it. Either by a fixed constant (like 1 for counting), or using a field (like for a specialized running sum). This is typically in the details of the group
  • The third displays the value of the variable. This is either in the group (to show the value for every member of the group), or in the group footer when showing a grand total.
1 Like

Talking of SSRS reports has anyone figured out how to print the report footer at the bottom of the page. In Crystal it was very easy. At present it prints in the middle of wherever it ends and looks awful.

Thanks for your help.

Vinay Kamboj

I usually use that but no longer works I saw folks mention it worked in the past… I wonder if it doesnt work when one uses the Reset Page Count on a Group functionality (Ex: Job Traveler).

1 Like

Just tested this out on a Straight SQL blank report. 1 of 1 :frowning:

Anyone else feel like SSRS is getting harder as it ages? lol

1 Like