Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2012
    Posts
    2

    Unanswered: Conditional Formatting Expression Help

    Hey all,

    I'm trying to put conditional formatting on a field, that behaves as follows:

    The data in the field is varchar, and sample data is either:
    NULL
    3.0 :0
    11.7 :1 (these are ratios of a sort)

    I want to evaluate the first 3 characters of the string as numbers.

    Example:
    Mid(fieldvalue,1,3) = "3.0" or "11."

    Any data that is greater than 1.99, I want to make the background dark red, anything else including nulls, zebra formatting. I have the following expression built so far and it appears to work, except when the value is null. If the value is null, it leaves the background color white. If you get a chance to take a look I appreciate any help. This is the warning: [rsRuntimeErrorInExpression] The BackgroundColor expression for the text box ‘Asthma’ contains an error: Input string was not in a correct format.

    =iif(
    isnothing(Fields!Asthma.Value)
    ,(IIf(RowNumber(Nothing) Mod 2 = 0,"#b8cce4","#dbe5f1"))
    ,(iif(mid(Fields!Asthma.Value,1,3)>1.99
    ,"DarkRed"
    ,IIf(RowNumber(Nothing) Mod 2 = 0,"#b8cce4","#dbe5f1"))))

    My logic is, if the field is null, zebra format, if mid of the value is > 1.99, dark red, everything else zebra formatting. As I said, this seems to work except for nulls.

    Thanks for help!

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Are we to assume you are playing with SSRS or another piece of reporting software?
    George
    Home | Blog

  3. #3
    Join Date
    Mar 2012
    Posts
    2
    Sorry for being vague. It is SRSS

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •