locked
Change row colour based on two conditions RRS feed

  • Question

  • Please help. I ran the expression below in background property the result is "White" for all rows including where row value is empty string. The second part of the expression was not run.

    =IIF(Me.Value = "", "PaleGoldenrod",
       IIF(Me.Value >= ReportItems!Textbox7.Value , "Green","Red"))  Help Appreciated.

    Friday, April 20, 2012 1:44 PM

Answers

  • Hi Timi_1,

    In Reporting Services, to judge whether an expression has no object, we can use the IsNothing function. To resolve the issue, please try the expression below:
    =IIF(IsNothing(Fields!Me.Value), "PaleGoldenrod", IIF(Fields!Me.Value >= ReportItems!Textbox7.Value, "Green", "Red"))

    OR

    =IIF(Fields!Me.Value Is Nothing, "PaleGoldenrod", IIF(Fields!Me.Value >= ReportItems!Textbox7.Value, "Green", "Red"))

    Reference:
    IsNothing Function

    If you have any questions, please feel free to let me know.

    Regards,
    Mike Yin

    • Marked as answer by Mike Yin Sunday, April 29, 2012 3:36 PM
    Tuesday, April 24, 2012 8:10 AM
  • use this as follows;

    =IIF(Fields!Me.Value Is Nothing or Fields!Me.Value ="", "PaleGoldenrod", IIF(Fields!Me.Value >= ReportItems!Textbox7.Value, "Green", "Red"))

    If you have any query, please feel free ask.

    Regards,

    Noman Rao

    • Proposed as answer by Noman Rao Tuesday, April 24, 2012 1:56 PM
    • Marked as answer by Mike Yin Sunday, April 29, 2012 3:35 PM
    Tuesday, April 24, 2012 1:55 PM

All replies

  • Are you giving this for Row's background property ?

    Can you please try this for individual cell or instead of Me.Value can you please use Fields!YourFieldName.Value


    Bipin. P | ERNST & YOUNG GSS

    Friday, April 20, 2012 2:11 PM

  • Thanks. The expression works on individaul cell where the condition is true but applies white to other cell where condition is false instead of expressing the "green" or "red" values.


    The field am working on are virtual fields where values are determined by expressions.
    Does Switch funxtion works on Virtual fields?

    • Marked as answer by Mike Yin Sunday, April 29, 2012 3:30 PM
    • Unmarked as answer by Mike Yin Sunday, April 29, 2012 3:36 PM
    Friday, April 20, 2012 3:01 PM
  • Hi Timi_1,

    In Reporting Services, to judge whether an expression has no object, we can use the IsNothing function. To resolve the issue, please try the expression below:
    =IIF(IsNothing(Fields!Me.Value), "PaleGoldenrod", IIF(Fields!Me.Value >= ReportItems!Textbox7.Value, "Green", "Red"))

    OR

    =IIF(Fields!Me.Value Is Nothing, "PaleGoldenrod", IIF(Fields!Me.Value >= ReportItems!Textbox7.Value, "Green", "Red"))

    Reference:
    IsNothing Function

    If you have any questions, please feel free to let me know.

    Regards,
    Mike Yin

    • Marked as answer by Mike Yin Sunday, April 29, 2012 3:36 PM
    Tuesday, April 24, 2012 8:10 AM
  • use this as follows;

    =IIF(Fields!Me.Value Is Nothing or Fields!Me.Value ="", "PaleGoldenrod", IIF(Fields!Me.Value >= ReportItems!Textbox7.Value, "Green", "Red"))

    If you have any query, please feel free ask.

    Regards,

    Noman Rao

    • Proposed as answer by Noman Rao Tuesday, April 24, 2012 1:56 PM
    • Marked as answer by Mike Yin Sunday, April 29, 2012 3:35 PM
    Tuesday, April 24, 2012 1:55 PM