Kbase 13736: Report Builder override filter with numeric runtime variable
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  10/15/2008 |
|
Status: Verified
GOAL:
How to call the Report Builder Engine and build the filter condition.
GOAL:
Numeric runtime variable used.
FIX:
Report Builder override filter with numeric runtime variable
The following 4GL program will demonstrate how to call the
Report Builder Engine and build the filter condition. It is prompting
the user for input, then building the filter expression.
/* overriding the default filter...this is with a numeric expression */
DEF VAR test AS CHAR FORMAT "x(20)".
DEF VAR mycust AS CHAR.
UPDATE mycust.
test = "cust-num <=" + mycust.
DISPLAY test.
/* overrides filter condition */
RUN aderb/_printrb.p
("<Path to your prl file>\reports.prl",/* RB-REPORT-LIBRARY */
"<The name of a saved report>", /* RB-REPORT-NAME */
"", /* RB-DB-CONNECTION */
"O", /* RB-INCLUDE-RECORDS */
test, /* RB-FILTER */
"", /* RB-MEMO-FILE */
"D", /* RB-PRINT-DESTINATION */
"", /* RB-PRINTER-NAME */
"", /* RB-PRINTER-PORT */
"", /* RB-OUTPUT-FILE */
1, /* RB-NUMBER-COPIES */
1, /* RB-BEGIN-PAGE */
99999, /* RB-END-PAGE */
no, /* RB-TEST-PATTERN */
"", /* RB-WINDOW-TITLE */
yes, /* RB-DISPLAY-ERRORS */
yes, /* RB-DISPLAY-STATUS */
no, /* RB-NO-WAIT */
""). /* RB-OTHER-PARAMETERS */
----------------------------------------------------------------
This is an example of passing the runtime variable when
the variable is a numeric field. The variable must be
converted to a string.
DEF VAR test AS CHAR FORMAT "x(20)".
DEF VAR mycust as INTEGER.
UPDATE mycust.
test = "cust-num <= " + STRING(mycust).
DISPLAY test.
RUN aderb/_printrb.p
("<Path to your prl file>\reports.prl",/* RB-REPORT-LIBRARY */
"<The name of a saved report>", /* RB-REPORT-NAME */
"", /* RB-DB-CONNECTION */
"O", /* RB-INCLUDE-RECORDS */
test, /* RB-FILTER */
"", /* RB-MEMO-FILE */
"D", /* RB-PRINT-DESTINATION */
"", /* RB-PRINTER-NAME */
"", /* RB-PRINTER-PORT */
"", /* RB-OUTPUT-FILE */
1, /* RB-NUMBER-COPIES */
0, /* RB-BEGIN-PAGE */
999, /* RB-END-PAGE */
no, /* RB-TEST-PATTERN */
"", /* RB-WINDOW-TITLE */
yes, /* RB-DISPLAY-ERRORS */
yes, /* RB-DISPLAY-STATUS */
no, /* RB-NO-WAIT */
""). /* RB-OTHER-PARAMETERS */