Hello All,
I have a problem with the colouring of certain rows in a dynamic browse.
I’ll show what I have got:
/*********************** PROCEDURE to build the browse**********************/
CREATE BUFFER table-name FOR TABLE "tt_productie".
CREATE QUERY dyn-query.
CREATE BROWSE dyn-browse-prod
ASSIGN WIDTH = 71
HEIGHT = 12
EXPANDABLE = FALSE
COLUMN = 1
ROW = 1
FRAME = FRAME frm_prod:HANDLE
READ-ONLY = TRUE
SENSITIVE = TRUE
SEPARATORS = TRUE
ROW-MARKERS = TRUE
VISIBLE = TRUE
COLUMN-RESIZABLE = TRUE
TRIGGERS:
ON ROW-DISPLAY PERSISTENT RUN prodCol.
ON LEFT-MOUSE-CLICK PERSISTENT RUN reposPers(INPUT "prod").
ON 'RIGHT-MOUSE-CLICK' PERSISTENT RUN rightProd.
END.
/* attach the query to the browser */
dyn-browse-prod:QUERY = dyn-query.
/* query value is the string which will be used to open the query */
query-value = "For each tt_productie by dept by part by machine"
/*where dwpdc_mstr.dwpdc_date >= 19/03/2007"*/.
/* prepare and open the query */
dyn-query:QUERY-PREPARE(query-value).
ASSIGN v_list = "tt_productie.keynr,tt_productie.dept,tt_productie.machine,tt_productie.tiknr,tt_productie.action,tt_productie.prodtijd,tt_productie.prodstil,tt_productie.totaal".
DO cntr = 1 TO NUM-ENTRIES(v_list, ","):
col-handle = dyn-browse-prod:ADD-LIKE-COLUMN(ENTRY(cntr,v_list, ",")).
col-handle:READ-ONLY = TRUE.
IF cntr = 1
THEN col-handle:VISIBLE = FALSE.
ASSIGN v_collist[cntr] = col-handle:HANDLE.
CASE cntr:
WHEN 2 THEN col-handle:WIDTH = 6.
WHEN 3 THEN col-handle:WIDTH = 13.
WHEN 4 THEN col-handle:WIDTH = 7.
OTHERWISE col-handle:WIDTH = 8.
END CASE.
END.
dyn-query:QUERY-OPEN().
APPLY "home" TO dyn-browse-prod.
END PROCEDURE.
In the row-display trigger of the browse I want to colour certain rows depending on a value in a column of that row.
As you can see above I do the following to run this trigger:
ON ROW-DISPLAY PERSISTENT RUN prodCol.
Here is the problem.
I have a list of all collumn-handles but i am not able to to a check within the row-display on buffer-value or screen-value.
/*********************** PROCEDURE prodCol**********************/
DEFINE VARIABLE v_i AS INT NO-UNDO.
DEFINE VARIABLE col-handle AS HANDLE NO-UNDO.
ASSIGN v_i = 1.
DO WHILE v_i <= 8:
/*here is the problem. i can not use buffer-field, buffer-value or screen-value in this row-display trigger*/
ASSIGN fld-handle = col-handle:BUFFER-FIELD.
MESSAGE fld-handle:SCREEN-VALUE.
MESSAGE fld-handle:BUFFER-VALUE.
col-handle:BGCOLOR = 12.
ASSIGN v_i = v_i + 1.
END. /*DO WHILE v_i <= 8*/
END PROCEDURE.
The messages I got when i try to run the above or a part of it
Thanks a lot!
Kind regards,
Elise
I have a problem with the colouring of certain rows in a dynamic browse.
I’ll show what I have got:
/*********************** PROCEDURE to build the browse**********************/
CREATE BUFFER table-name FOR TABLE "tt_productie".
CREATE QUERY dyn-query.
CREATE BROWSE dyn-browse-prod
ASSIGN WIDTH = 71
HEIGHT = 12
EXPANDABLE = FALSE
COLUMN = 1
ROW = 1
FRAME = FRAME frm_prod:HANDLE
READ-ONLY = TRUE
SENSITIVE = TRUE
SEPARATORS = TRUE
ROW-MARKERS = TRUE
VISIBLE = TRUE
COLUMN-RESIZABLE = TRUE
TRIGGERS:
ON ROW-DISPLAY PERSISTENT RUN prodCol.
ON LEFT-MOUSE-CLICK PERSISTENT RUN reposPers(INPUT "prod").
ON 'RIGHT-MOUSE-CLICK' PERSISTENT RUN rightProd.
END.
/* attach the query to the browser */
dyn-browse-prod:QUERY = dyn-query.
/* query value is the string which will be used to open the query */
query-value = "For each tt_productie by dept by part by machine"
/*where dwpdc_mstr.dwpdc_date >= 19/03/2007"*/.
/* prepare and open the query */
dyn-query:QUERY-PREPARE(query-value).
ASSIGN v_list = "tt_productie.keynr,tt_productie.dept,tt_productie.machine,tt_productie.tiknr,tt_productie.action,tt_productie.prodtijd,tt_productie.prodstil,tt_productie.totaal".
DO cntr = 1 TO NUM-ENTRIES(v_list, ","):
col-handle = dyn-browse-prod:ADD-LIKE-COLUMN(ENTRY(cntr,v_list, ",")).
col-handle:READ-ONLY = TRUE.
IF cntr = 1
THEN col-handle:VISIBLE = FALSE.
ASSIGN v_collist[cntr] = col-handle:HANDLE.
CASE cntr:
WHEN 2 THEN col-handle:WIDTH = 6.
WHEN 3 THEN col-handle:WIDTH = 13.
WHEN 4 THEN col-handle:WIDTH = 7.
OTHERWISE col-handle:WIDTH = 8.
END CASE.
END.
dyn-query:QUERY-OPEN().
APPLY "home" TO dyn-browse-prod.
END PROCEDURE.
In the row-display trigger of the browse I want to colour certain rows depending on a value in a column of that row.
As you can see above I do the following to run this trigger:
ON ROW-DISPLAY PERSISTENT RUN prodCol.
Here is the problem.
I have a list of all collumn-handles but i am not able to to a check within the row-display on buffer-value or screen-value.
/*********************** PROCEDURE prodCol**********************/
DEFINE VARIABLE v_i AS INT NO-UNDO.
DEFINE VARIABLE col-handle AS HANDLE NO-UNDO.
ASSIGN v_i = 1.
DO WHILE v_i <= 8:
/*here is the problem. i can not use buffer-field, buffer-value or screen-value in this row-display trigger*/
ASSIGN fld-handle = col-handle:BUFFER-FIELD.
MESSAGE fld-handle:SCREEN-VALUE.
MESSAGE fld-handle:BUFFER-VALUE.
col-handle:BGCOLOR = 12.
ASSIGN v_i = v_i + 1.
END. /*DO WHILE v_i <= 8*/
END PROCEDURE.
The messages I got when i try to run the above or a part of it
- 5906 : Buffer-field cannot be queried within a row-display trigger for fill in total.
- 3135: Invalid widget-handle. Not initialised or point to a deleted widget
- 3140: Cannot acces the Buffer-value attribute because the widget does not exist.
Thanks a lot!
Kind regards,
Elise