Last post Jul 25, 2012 08:12 AM by vicky1
Dec 10, 2009 03:54 AM|amodi|LINK
I want to change the font color based on condition, I have a field of type "TimeSpan" and i wanted to change the color of that field(textbox). For example is the field value is equal to or more than 5 hours as "05:20:45" then the font
color should be "Green" and if the field value is less than 5 hours as "04:12:35" then the font color should be "Red"
Hope i am clear.
Dec 10, 2009 04:26 AM|G0ggy|LINK
If the hours are always 2 digits, this can easily be achieved with:
If Convert.ToInt32(Left("05:15:23", 2)) < 5 Then
TextBox1.ForeColor = System.Drawing.Color.Red
TextBox1.ForeColor = System.Drawing.Color.Green
Dec 10, 2009 04:32 AM|arunkumarsp|LINK
Hope the below expression will help you
Dec 10, 2009 05:33 AM|amodi|LINK
Thanks guys. G0ggy Sorry for not being clear. actually i was talking about microsoft reports .rdlc.
arunkumarsp i tried as you said but got the #Error in place of the TimeSpan textbox. Any other solution?
Dec 10, 2009 05:40 AM|arunkumarsp|LINK
Instaed of Fields!Timespan.Value give your field name. I tested this and its working fine for me.
Jul 25, 2012 08:12 AM|vicky1|LINK
Hi sir same problem i have
I am having date value and i want that when same date is showing in two row it should be with some background color
i used your formula
it's working but not in correct way.
i used like this.
it showing all dates value green which is greater than two.
how to compare it plz help me.