color the text box for the value!

  • Hi all,

    I would like to know if i would be able to fill the color in text box as the value of column.

    Such as

    I have 4 text box in line. each from 1-25, 2nd 26-50, 3rd 51-75, and 4th 76 -100 range. I want to color the text box as if the value is 24% then color the text box 1 with red.. and if the value is 29% then color the textbox 1 till 25 and text box 2 with 4 more and show the value?

    Is it possible? if so how?

    Please guide!!

    Thanks

    Pat

  • What tool are you using to display the values? Are you using Excel, SSAS, SSRS, something else? Within SSAS you can define this logic and you can then utilize that in Excel 2007. If you are doing this in SSRS then you just need to define the expression in the properties of the textbox for the Background Color.

    In SSRS by default the textbox color expression is Transparent. You would want to change this to implement your logic using a SWITCH statement. Like the following:

    =Switch(Fields!PctComplete.Value >= 80, "Green", Fields!PctComplete.Value >= 50, "Blue", Fields!PctComplete.Value >= 25, "Yellow", Fields!PctComplete.Value <= 24, "Red")

    If this type of logic is going to be used repeatedly throughout the report then implementing this into the Code region of the report and passing in the Value would make it easier to reuse.

    With some additional details about what tool you are using and more information on how you are trying to use this would help.

    ----------------------------------------------------------------------------------------
    Dan English - http://denglishbi.wordpress.com

  • Hi sorry for the confusion,

    I am trying to use SSRS. I tried that logic before but i only colors the whole text box not the value. and it does not go to second text box

    such as first textbox has up to 25% and second from 26 to 50% so if the value is 32 then it needs to color first text box with yellow and then remainder 7 on seccond text box not whole box!!

    Thanks

    Pat

  • Sorry, I am really not understanding the logic and what you are trying to do. Very difficult to understand what you are trying to accomplish. I thought you were trying to include conditional formatting in your text box report items to change the background color, but apparently that is not the case. If it is this logic needs to be included in the properties of each text box background color property. Maybe you just want to change the font color? Not sure exactly what you are trying to do with all of the text boxes and logic here and am unable to get a visual of what the report layout is right now.

    Maybe you are trying to treat each text box differently and only need to include a portion of the logic with each text box instead of the entire SWITCH statement. If you include the entire SWITCH statement in each text box then it would set all of them to the same color and I don't believe that is what you want. You will just want to include the logic needed to change the color of each text box in this case and for that you wouldn't need to use the SWITCH statement, but you still could. You could just say:

    text box 1: =iif(Fields!PctComplete.Value >= 80, "Green", "Transparent")

    text box 2: =iif(Fields!PctComplete.Value >= 50 AND Fields!PctComplete.Value < 80, "Blue", "Transparent")

    and so on... or what ever color is needed for each text box.

    ----------------------------------------------------------------------------------------
    Dan English - http://denglishbi.wordpress.com

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

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