Reporting Services’s RepeatOnNewPage property – that elusive feature
For my first post (please be gentle with me), I’d like to write about something that’s been bugging me time and time again in SSRS: the RepeatOnNewPage property.
In all my list type reports, I want my users to be able to see the nice column headers on every page of the report and not just at the beginning of it (who would want that anyway?).
Here’s what you have to do:
- Select the Advanced option from the arrow on the right of the groupings pane so to show every group;
- From the new “Static” groups that appeared, one (or more) is your header row. Essentially, it’s the row(s) containing the column headers (in my screenshot, I selected the first Static row group);
- In the properties for that group, set the RepeatOnNewPage property to True;
Normally, one would think that this would be it. The property is namedRepeatOnNewPage after all. Well NO! At least, not always. That’s the part I was struggling with for over a year. Even if that property was set to true, the column headers would never repeat on the new page. Searching on the web never turned up anything that was of any help to me.
I later found out that it was so because I, as I usually do, had deleted the group header column. When you add a row grouping in SSRS, the default behavior is to add a column that spans over all the child groups. That group header column, had I kept it there, would have span over the entire child groups and so, the parent group would always have been visible (or should I say contextually current) and my column headers would therefore always have been visible.
After nearly two years of working around that issue by keeping the group header column but making it as small as possible because hiding it had an unwanted effect for design vs runtime layout, the answer finally came to me. I was showing a report to a coworker who asked “What does the KeepWithGroup” property do?” And then it hit me.
If I “keep my parent group” with the child group using theAftersetting, the parent group would always be “contextually current” (or visible if you will). I tried it and voila! My column headers were repeating as I wanted them to be two years before.
So there you have it: repeating headers even if, like me, you don’t want to use the group header column that SSRS adds, by default, when you create a group.