Condiditional Formatting Rows

  • ssrs 2008 r2

    I have a report where we alternate row colors using = IIf(RowNumber(Nothing) Mod 2 = 0, "Silver", "Transparent")

    is there a way to also highlight a specific row when a second condition is met?

    =iif(Fields!unreleaseflag.Value = "1", "Red","White")

    I am not sure if this can be accomplished and if it can, how to combine the two statements.

  • You could probably do it with a nested iif statement make the false part of that nested iif statement your alternating row color expression.

  • danielle476 (12/30/2010)


    ssrs 2008 r2

    I have a report where we alternate row colors using = IIf(RowNumber(Nothing) Mod 2 = 0, "Silver", "Transparent")

    is there a way to also highlight a specific row when a second condition is met?

    =iif(Fields!unreleaseflag.Value = "1", "Red","White")

    I am not sure if this can be accomplished and if it can, how to combine the two statements.

    Use a SWITCH statement.

    =SWITCH(Fields!unreleaseflag.Value = "1", "Red",

    RowNumber(Nothing) Mod 2, "Silver",

    1=1, "Transparent")

    SWITCH is ALWAYS a better idea than nested IIFs. The problems with the Nested IIF structure are twofold. 1) They can be a beast to sort out what is happening.

    2) At runtime, the 'puter always evaluates the ENTIRE expression, even if the very first IIF is satisfied.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply