none
Help with formatting expression RRS feed

  • Question

  • =IIF(Fields!est_delivery.Value >= Today or Fields!est_delivery.Value <> " ", "Transparent", "Red")

     

    That's what I have in the background color option, what I want it to do is color the background red if the est_delivery date has passed.  I can get it to do that, but for columns that don't have a date in that field, it also highlights those.  I don't want it highlighting the blank fields, how can I combine the two?

    I tried this also:

     

    =IIF(fields!est_delivery.value = " ", "Transparent", IIF(Fields!est_delivery.Value >= Today, "Transparent", "Red"))

     

    But that did the exact opposite of what I wanted and only colored the blank fields red.

    Wednesday, April 13, 2011 3:58 PM

All replies

  • Hi,
    I suspect the following. The dates that appear as blank are not exactly blank. Probably, they have Date's max value, something like (12/31/9999).

    Could you verify the dates in the dataset or Result DataTable that you are binding with the report(and not in the report's view mode)? Based on that, you would need to chnage your expession.


    Regards, Lakra :) - If the post is helpful or answers your question, please mark it as such.
    Thursday, April 14, 2011 3:50 AM
  • The "blanks" are actually "NULL", how would I need to change the expression?  I'm not sure how to call NULL in an expression.
    Thursday, April 14, 2011 12:26 PM
  • I think i figured it out:

    =IIF(Fields!est_delivery.Value >= Today or Fields!est_delivery.Value = nothing, "Transparent", "Red")

     

    Thanks for the hint.  I thought it might be something like that but I wasn't sure.

    Thursday, April 14, 2011 1:52 PM
  • Well, good to know that you were able to manage.

    One more possiblity in your case is -
    In your SQL, modify the SQL for the column that returns null in your select clause as something like: Instead of writing [SELECT COLUMN_NAME.....] use SELECT ISNULL(COLUMN_NAME, '').

    This would not return NULL but "" (blank). Then you can even use your previous expression.


    Regards, Lakra :) - If the post is helpful or answers your question, please mark it as such.
    Monday, April 18, 2011 9:01 AM