Information générale
Catégorie:
Codage, syntaxe et commandes
Titre:
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
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement