Kbase P19277: How to create a Progress 4GL interface to Report Builder
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  5/10/2010 |
|
Status: Verified
GOAL:
How to create a Progress 4GL interface to Report Builder
GOAL:
How to use Report Engine Table Interface
GOAL:
How to use Report Engine PRINTRB and PRNTRB2 Interface
FACT(s) (Environment):
All Supported Operating Systems
Progress 9.x
OpenEdge 10.x
OpenEdge Category: Language (4GL/ABL)
FIX:
Progress provides two methods to call the Report Builder Runtime Engine in Progress:
- The Report Engine PRINTRB and PRNTRB2 Interface
- The Report Engine Table Interface
Samples of usages are available in the DLC\SRC\ADERB\EXAMPLES directory.
This solution samples the PRINTRB interface.
This interface use principally two Progress procedures:
- aderb/_printrb.p
which actually calls the Report Builder Runtime Engine passing
parameters to set its behavior.
and
- aderb/_getname.p.
which retrieves the report names available in a Progress Report
Builder file (.PRL)
Those names are user-oriented names, e.g., "Monthly Sales Report"
rather than REPORT001.
You can create a easy interface to call the Report Builder following these steps:
- Create a new window using the UIB
- Drop in it a combo-box (or a selection-list), and name this CB-RB
- Add an ENTRY event with the following code:
/* This code will get the comma separated list of names, and put this in the combo-box. Note the usage of SELF rather than CB-RB. */
DO:
DEFINE VARIABLE report-list AS CHARACTER NO-UNDO.
DEFINE VARIABLE report-count AS INTEGER NO-UNDO.
RUN aderb/_getname.p
(
INPUT "REPORTS.PRL",
OUTPUT report-list,
OUTPUT report-count
).
ASSIGN
SELF:LIST-ITEMS = report-list.
IF report-count > 0 THEN SELF:SCREEN-VALUE = SELF:ENTRY(1).
END.
- Add a button to this window, it will call the Report Builder Engine.
- Use the code below for the CHOOSE trigger of the button.
DO:
DEFINE VARIABLE RB-LIBRARY-NAME AS CHARACTER NO-UNDO.
DEFINE VARIABLE RB-REPORT-NAME AS CHARACTER NO-UNDO.
DEFINE VARIABLE RB-DB-CONNECTION AS CHARACTER NO-UNDO.
DEFINE VARIABLE RB-INCLUDE-RECORDS AS CHARACTER NO-UNDO.
DEFINE VARIABLE RB-FILTER AS CHARACTER NO-UNDO.
DEFINE VARIABLE RB-MEMO-FILE AS CHARACTER NO-UNDO.
DEFINE VARIABLE RB-PRINT-DESTIONATION AS CHARACTER NO-UNDO.
DEFINE VARIABLE RB-PRINTER-NAME AS CHARACTER NO-UNDO.
DEFINE VARIABLE RB-PRINTER-PORT AS CHARACTER NO-UNDO.
DEFINE VARIABLE RB-OUTPUT-FILE AS CHARACTER NO-UNDO.
DEFINE VARIABLE RB-NUMBER-COPIES AS INTEGER NO-UNDO.
DEFINE VARIABLE RB-BEGIN-PAGE AS. INTEGER NO-UNDO.
DEFINE VARIABLE RB-END-PAGE AS INTEGER NO-UNDO.
DEFINE VARIABLE RB-TEST-PATTERN AS LOGICAL NO-UNDO.
DEFINE VARIABLE RB-WINDOW-TITLE AS CHARACTER NO-UNDO.
DEFINE VARIABLE RB-DISPLAY-ERRORS AS LOGICAL NO-UNDO.
DEFINE VARIABLE RB-DISPLAY-STATUS AS LOGICAL NO-UNDO.
DEFINE VARIABLE RB-NO-WAIT AS LOGICAL NO-UNDO.
DEFINE VARIABLE RB-OTHER-PARAMETERS AS CHARACTER NO-UNDO.
ASSIGN
RB-LIBRARY-NAME = "REPORTS.PRL"
RB-REPORT-NAME = CB-RB:SCREEN-VALUE
RB-DB-CONNECTION = "-db sports2000 -H localhost -N tcp -S 23456"
RB-INCLUDE-RECORDS = "E"
RB-FILTER = ""
RB-MEMO-FILE = ""
RB-PRINT-DESTIONATION = "D"
RB-PRINTER-NAME = ?
RB-PRINTER-PORT = ?
RB-OUTPUT-FILE = ""
RB-NUMBER-COPIES = 0
RB-BEGIN-PAGE = 0
RB-END-PAGE = 0
RB-TEST-PATTERN = FALSE
RB-WINDOW-TITLE = RB-REPORT-NAME
RB-DISPLAY-ERRORS = TRUE
RB-DISPLAY-STATUS = TRUE
RB-NO-WAIT = FALSE
RB-OTHER-PARAMETERS = "".
RUN aderb/_printrb.p
(
INPUT RB-LIBRARY-NAME,
INPUT RB-REPORT-NAME,
INPUT RB-DB-CONNECTION,
INPUT RB-INCLUDE-RECORDS,
INPUT RB-FILTER,
INPUT RB-MEMO-FILE,
INPUT RB-PRINT-DESTIONATION,
INPUT RB-PRINTER-NAME,
INPUT RB-PRINTER-PORT,
INPUT RB-OUTPUT-FILE,
INPUT RB-NUMBER-COPIES,
INPUT RB-BEGIN-PAGE,
INPUT RB-END-PAGE,
INPUT RB-TEST-PATTERN,
INPUT RB-REPORT-NAME,
INPUT RB-DISPLAY-ERRORS,
&.nbsp; INPUT RB-DISPLAY-STATUS,
INPUT RB-NO-WAIT,
INPUT RB-OTHER-PARAMETERS
).
END.
- This program uses the library REPORTS.PRL in the default directory, change the reference to this library according to your environment.
- At this time you get an interface to Report Builder from Progress 4GL..