Simple Conditional Formatting

  • I've just created a simple report where a user must choose one of four options in a pre-populated dropdown box. I'd now like to format the results depending on the value they selected.

    Initially I'd just want to format the background colours of the report headings, if possible other things too such as the colour of the report title.

    I've looked into the background colour side of things and got as far as seeing I can specify an expression, then I get a little stuck..

    =Parameters!ParamA.Value=

    I'm not sure how I specify the colour and the value - these sort of expressions are totally new to me. I've taken a look at the help files and I'm still confused :/

    On a slight aside - Can I have the paramater chosen as part of the report title? - For example 'Stock List - @FoodType' might produce Stock List - Fruit or Stock List - Crisps etc

    Thanks in advance... I'm sure it's something really simple that I'm just not appreciating!

  • Rob-350472 (1/12/2011)


    I've just created a simple report where a user must choose one of four options in a pre-populated dropdown box. I'd now like to format the results depending on the value they selected.

    Initially I'd just want to format the background colours of the report headings, if possible other things too such as the colour of the report title.

    I've looked into the background colour side of things and got as far as seeing I can specify an expression, then I get a little stuck..

    =Parameters!ParamA.Value=

    I'm not sure how I specify the colour and the value - these sort of expressions are totally new to me. I've taken a look at the help files and I'm still confused :/

    On a slight aside - Can I have the paramater chosen as part of the report title? - For example 'Stock List - @FoodType' might produce Stock List - Fruit or Stock List - Crisps etc

    Thanks in advance... I'm sure it's something really simple that I'm just not appreciating!

    I believe something like this is what you need

    =iif(Parameters!ParamA.Value=1,"Red","Black")

    Yes you can show parameters in the report title as well.

    ="Stock List " & Parameters!FoodType.Value

  • Daniel, I've made some progress on the colour front. I used the iif side of things for my first attempt which seemed to work, not sure why it didn't before! But then as an enhancement I used switch:

    =Switch(Parameters!ParamA.Value = "A", "Blue",

    Parameters!ParamA.Value = "B", "Red",

    Parameters!ParamA.Value = "C", "Green",

    Parameters!ParamA.Value = "D", "Orange")

    Which seems to be working nicely.

    Thanks for the tip on the params in the report title too, a colleague told me I could drag and drop it in, which I did, and then adapted the expression above to substitute A for example with Apples etc. Seems to be working well.

    I bet the user doesn't even notice the title and colour change!

    Thanks for the help 🙂

  • Switch is definitely an easier option when you have multiple conditions

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

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