RE:Cómo llamar un reporte de un menú
How to create a Progress 4GL interface to Report Builder
Progress provides two methods to call the Report Builder Runtime
Engine in Progress V8:
- The Report Engine PRINTRB Interface (available in V7)
- The Report Engine Table Interface
Samples of usages are available in the DLC\SRC\ADERB\EXAMPLES
directory.
This knowledgebase 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.
*/
DEF VAR report-list AS CHAR.
DEF VAR report-count AS INT.
RUN aderb/_getname.p ("REPORTS.PRL",
OUTPUT report-list,
OUTPUT report-count).
SELF:LIST-ITEMS = report-list.
IF report-count > 0 THEN SELF:SCREEN-VALUE = SELF:ENTRY(1).
- Add a button to this window, it will call the Report Builder Engine.
- Use the code below for the CHOOSE trigger of the button.
DEF VAR RB-LIBRARY-NAME AS CHAR.
DEF VAR RB-REPORT-NAME AS CHAR.
DEF VAR RB-DB-CONNECTION AS CHAR.
DEF VAR RB-INCLUDE-RECORDS AS CHAR.
DEF VAR RB-FILTER AS CHAR.
DEF VAR RB-MEMO-FILE AS CHAR.
DEF VAR RB-PRINT-DESTIONATION AS CHAR.
DEF VAR RB-PRINTER-NAME AS CHAR.
DEF VAR RB-PRINTER-PORT AS CHAR.
DEF VAR RB-OUTPUT-FILE AS CHAR.
DEF VAR RB-NUMBER-COPIES AS INTEGER.
DEF VAR RB-BEGIN-PAGE AS INT.
DEF VAR RB-END-PAGE AS INT.
RB-LIBRARY-NAME = "REPORTS.PRL".
RB-REPORT-NAME = CB-RB:SCREEN-VALUE.
RB-DB-CONNECTION = "".
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.
RUN aderb/_printrb.p ( RB-LIBRARY-NAME ,
RB-REPORT-NAME ,
RB-DB-CONNECTION ,
RB-INCLUDE-RECORDS,
RB-FILTER,
RB-MEMO-FILE,
RB-PRINT-DESTIONATION,
RB-PRINTER-NAME,
RB-PRINTER-PORT,
RB-OUTPUT-FILE,
RB-NUMBER-COPIES,
RB-BEGIN-PAGE,
RB-END-PAGE,
FALSE,
RB-REPORT-NAME,
TRUE,
TRUE,
FALSE,
"").
- 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.
Please refer to the Progress Report Builder documentation for an
explanation of these parameters.
REFERENCES TO WRITTEN DOCUMENTATION:
====================================
- PROGRESS Report Builder Deployment Guide
- PROGRESS Report Builder Tutorial
- PROGRESS Report Builder User's Guide
EDSEL Dec/1997
Progress Software Technical Support Note # 17479