SSRS (2005): conditionally format null/zero count cells based on group

ssrsssrs-2005

Okay, so I have an SSRS report column-grouped by weeks wait (and sorted by days wait, because weeks wait is a text category field), and a count of the number of people who've been waiting in each cell.

It's been requested that I format text in the 6+ weeks categories red and the remainder green for a quick visual representation of people who've been waiting an acceptable amount of time. So, the font colour is formatted with:

=Iif(Fields!Days_Wait.Value>42,"Red","Green")

However, this only works where the value has associated rows returned from the query. Where there's a count of 0 in the cell, it doesn't have a "Days_Wait" value to look up and so defaults to green.

Short of making the query return a whole load of superfluous empty lines so that every row category/column category combination has a row against it, is there any way to do this? I'm currently stuck with Visual Studio 2005 because the universe is a cold and unforgiving place.

Best Answer

I finally found the solution was to reference the category it's grouped by (weeks wait) - it's a little cumbersome because it's a string, but:

=Iif( Instr("7-8wks8-9wks[...]51-52 wks52 wks +",ReportItems!Weeks_Wait.Value) > 0,"Red","Green")