Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Different color row highlights for diff. criteria on a g
Message
De
07/08/2006 23:36:40
Aaron K. Y. Chu
Health & Care Co. Ltd.
Hong Kong, Hong Kong
 
 
À
07/08/2006 07:51:38
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01143188
Message ID:
01143682
Vues:
17
This message has been marked as a message which has helped to the initial question of the thread.
I think he could do that, by apply & pass 5 variables separately...

You should perform SQL Inner join with tables (dailywork & pkg) beforehand... Then you can send the data separately...
* If the data from table (pkg) is only a constant, you may not need to do SQL inner join
LPARAMETERS nmen, nwmn, nadl, nripe, ngreen

avg = ((nmen+nwmn+nadl)/(nripe+ngreen))
DO CASE
	CASE avg >= 0 and avg < 20
	 nColor = RGB(0,0,100)
	CASE avg >= 20 and avg < 30
	 nColor = RGB(100,0,100)
	CASE avg >= 30 and avg < 40
	 nColor = RGB(200,0,100)
	CASE avg >= 40 and avg < 60
	 nColor = RGB(0,100,100)
	CASE avg >= 60
	 nColor = RGB(0,200,100)
ENDCASE

RETURN ncolor

* in fact, you can do anything/calculation/screening/conditioning on this method

* Remember: you need to pass the data individually, since every record point is 
* evaluated individually when dynamic color is concerned & a grid could only display
* a single table, not 2 or more, so calling different tables' field could not change 
* the value passed
oGrd.recordsource = "SQL_dailywork_pkg"
ogrd.SetAll("DynamicBackColor", "thisform.getAVG(nmen,nwmn,nadl,nripe,ngreen)", "Column")
Hope this solve your problem... If so, please press the "Star" solution to signify this could be a solution...
Best regards,

Aaron Chu

********************************************************

Working with Visual FoxPro is a lot of FUN!

********************************************************
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform