Kbase P92095: How to color the even numbered rows of a freeform query based browse that has a calculated field?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  8/24/2004 |
|
Status: Unverified
GOAL:
How to color the even numbered rows of a freeform query based browse that has a calculated field?
FACT(s) (Environment):
Windows
FACT(s) (Environment):
Progress 8.x
FACT(s) (Environment):
Progress 9.x
FACT(s) (Environment):
OpenEdge 10.x
FIX:
The following solution assumed that the calculated field is simply twice the the value of the current customer balance:
1. In the 'Definitions' section, define a variable for the calculated field:
DEFINE VARIABLE dCalculatedField AS DECIMAL NO-UNDO.
2. In the 'DISPLAY' pseudo trigger, list the table and calculated fields:
custnum Name country balance dCalculatedField
3. In the 'OPEN_QUERY' pseudo trigger, open the query:
OPEN QUERY {&SELF-NAME} FOR EACH Customer NO-LOCK INDEXED-REPOSITION.
4. In the 'ROW-DISPLAY' trigger, compute the calculated field and color the rows:
ASSIGN
dCalculatedField = Customer.Balance * 2.
IF CURRENT-RESULT-ROW("{&BROWSE-NAME}") MODULO 2 = 0 THEN DO:
ASSIGN
Customer.custnum:BGCOLOR IN BROWSE browse-1 = 14
Customer.NAME:BGCOLOR IN BROWSE browse-1 = 14
Customer.Country:BGCOLOR IN BROWSE browse-1 = 14
Customer.Balance:BGCOLOR IN BROWSE browse-1 = 14
dCalculatedField:BGCOLOR IN BROWSE browse-1 = 14.
END.