Category Archives: SSRS
I don’t know about you but I hate leave build warnings when I work on something. I am usually not satisfied until Visual Studio’s Error List window is empty, free of any errors (of course) and of any warnings. Lately I was developing some reports for a client where I implemented alternate row coloring to ease the reading of a list-type report.
With the expression in this next screenshot, I get a light grey (WhiteSmoke actually) every odd row. On my even rows, I don’t want to set the background to white. I want it to be transparent so that any color of a control behind would show through. The problem is that when you use the constants in SSRS’s expression builder, selecting “No Color” gives you “Transparent” to use in your expression.
Oddly, using “Transparent” raises warnings in SSRS and doing so fills up the Warning list as such:
What you actually have to use is the Nothing key word and all warnings relating to “Transparent” not being a valid background color will go away. Nothing translates back to a transparent background at run-time so the final output is still the same.
I would have thought that the expression builder would have given me the correct constant to use though! I guess I’ll have to take the habit of writing “Nothing” instead of clicking on the “No Color” selection.
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.