January 8, 2013 at 4:25 am
Hi All,
I have a column 'RunTime' with following format of data in it. I need to give an expression for back ground color of this column as 'RED' if the RunTime >= 2 Hrs
For my earlier reports I was using = IIF(Fields!Runtime.Value > 2,"RED","SpringGreen") and it used to work. but I guess that because the column format was integer.
Can someone please help ASAP. Need to get this done tonight.
Thanks in Advance.
January 8, 2013 at 4:28 am
Could you not format out in the data set an int based column which is used in the expression, but not shown in the report?
January 8, 2013 at 4:35 am
sorry for confusion. here is what the column looks like.
22 Hrs : 34 Mins
16 Hrs : 34 Mins
8 Hrs : 35 Mins
0 Hrs : 36 Mins
Now i need to put red color for the ones that are >= 2 Hrs
January 8, 2013 at 4:36 am
Is there a way that I can take only the first digit of the column and see if its >= 2 and mark it as red color in the expression?
January 8, 2013 at 4:37 am
That was just my thought. I mean please share your idea how mark the background color as red.
January 8, 2013 at 4:47 am
Could you not get left 1, convert it to int, then do > 2
CInt(Left(Fields!Field.Value,1)) > 2
January 8, 2013 at 5:11 am
How can I add a condition to the below expression? Please help
(CInt(Left(Fields!Runtime.Value,1)) >= 2,"Red"),"Transparent"
January 8, 2013 at 5:12 am
You would just build that into your background expression as you have done
=IIF( CInt( Left(Fields!Runtime.Value,1)) >= 2,"Red","Transparent")
January 8, 2013 at 5:19 am
That worked thanks a lot. You saved me big time tonight..
January 8, 2013 at 5:25 am
Doh moment
LEFT("16",1) = 1 which doesnt match the value as that should go red, do left 2, so change it to CInt(REPLACE(LEFT(Fields!Field.Value,2)," ","")), that way if it picks "1 " or "0 " it will remove the space and do the correct comparission
Viewing 10 posts - 1 through 9 (of 9 total)
You must be logged in to reply to this topic. Login to reply