Change color of text by value

  • hi, im making a report with Report Builder and im trying to change the color of a text when the value changes

    for example if the value is - TOP RAIL, BOTTOM RAIL, MID RAIL, MID RAIL 1, MID RAIL 2 the text should be RED

    if the value is LEFT STILE, RIGHT STILE, MID STILE, MID STILE 1, MID STILE 2 the text should be BLUE

    any help would be great!

    Thanks

  • Add an expression to the colour on the text box which returns the colour. To start you off:
    =iif((Fields!YourField.Value = "TOP RAIL") Or (Fields!YourField.Value = "BOTTOM RAIL"), "Red", iif((Fields!YourField.Value = "LEFT STILE") Or (Fields!YourField.Value = "RIGHT STILE"), "Blue" "Black"))
    Alternatively, if you have very complex logic, you could use your query to do the work (as you have access to IN and proper CASE expressions), and return the colour you want as a value in a column. Then set the colour of the text box text to the value of that column (again using an expression).

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

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

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