Search code examples
sql-server-2008reporting-servicesssrs-2008ssrs-tablix

Assign value to cell in column depending on name of column - matrix


I have a matrix that dynamically displays columns and rows. (dûh)

I will always have a (dynamic) column with the name 'Everyone'. Now I am looking to color those cells green that have value > 0 AND columname 'Everyone'

I think I should be doing something with a IIF statement but how do I find the name of the column for a specific cell?

Thanks for thinking with me!

Henro


Solution

  • You can check if a column is in scope of a group (a column/row group) using an InScope expression - you should be able to do this on the background colour expression of the offending cell

    How is the column defined? Is it using a grouping or are you adding a static column using the advanced editor? Either way you should be able to use the InScope function to check if the cell belongs to a certain column

    e.g.

    =iif(someColumn.Value > 0 AND InScope("ColumnGroup"), "Green", Nothing)
    

    Give a bit more info on the groups/layout and I might be able to help a bit more