General information
Category:
Coding, syntax & commands
Title:
Displaying DynamicForeColor in grid
Hi All,
I have task to display different colors of the record in grid depending on following criteria:
* RGB(0,128,0) green
* RGB(0,0,255) blue
* RGB(255,128,0) orange
* RGB(255,255,0) red
pexp is the field name in my table
Now this is working but is not displaying RED color for the records where date of pexp is > then todays date
this.SetAll("DynamicForeColor",;
"IIF(hour(pexp)-hour(datetime())>3,RGB(0,128,0),;
iif(hour(pexp)-hour(datetime())=3, RGB(0,0,255),;
iif(hour(pexp)-hour(datetime())=2, RGB(255,128,0),;
iif(hour(pexp)-hour(datetime())<=1, RGB(255,0,0),RGB(200,0,0)))))","Column")
..so my expresion should be like
*thisform.aa = hour(datetime())
*!* WITH THISFORM
*!* this.SetAll("DynamicForeColor",;
*!* "IIF(hour(pexp)-.aa>3 and ttod(datetime())<=ttod(pexp),RGB(0,128,0),;
*!* iif(hour(pexp)-.aa=3 and and ttod(datetime())<=ttod(pexp), RGB(0,0,255),;
*!* iif(hour(pexp)-.aa=2 and ttod(datetime())<=ttod(pexp), RGB(255,128,0),;
*!* iif(hour(pexp)-.aa<=1 and ttod(datetime())<=ttod(pexp), RGB(255,0,0),RGB(200,0,0)))))","Column")
*!* ENDWITH
..but unfortunataly is longer the 255 characters.
Can anybody see another way of displaying the proper colors:
Text color criteria is:
if Expiry time >= 3 hours GREEN
if Expiry time = 3 hours BLUE
if Expiry time = 2 hours ORANGE
if Expiry time <= 1 hours RED and pexp is < todays date
Please help.
Thanks
Dejan
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only