Release 10.1A: OpenEdge Reporting:
Report Builder Deployment

> ## Running multiple reports in a batch

> You can run all the reports in the `rbsample.prl` report library as a batch job with the same set of parameters using `rbbatch.p`.

> To run the `rbbatch.p` procedure with the `rbsample.prl` report library, execute the following command:

>     RUN rbbatch.p ("c:\dlc\src\aderb\rbsample.prl")

> Here is the `rbbatch.p` procedure:

> rbbatch.p
>     /* 1 */
>       DEF VAR RB-REPORT-NAME AS CHARACTER INITIAL "".
>       DEF VAR RB-DB-CONNECTION AS CHARACTER INITIAL "".
>       DEF VAR RB-INCLUDE-RECORDS AS CHARACTER INITIAL "".
>       DEF VAR RB-FILTER AS CHARACTER INITIAL "".
>       DEF VAR RB-MEMO-FILE AS CHARACTER INITIAL "".
>       DEF VAR RB-PRINT-DESTINATION AS CHARACTER INITIAL "".
>       DEF VAR RB-PRINTER-NAME AS CHARACTER INITIAL "".
>       DEF VAR RB-PRINTER-PORT AS CHARACTER INITIAL "".
>       DEF VAR RB-OUTPUT-FILE AS CHARACTER INITIAL "".
>       DEF VAR RB-NUMBER-COPIES AS INTEGER INITIAL 1.
>       DEF VAR RB-BEGIN-PAGE AS INTEGER INITIAL 0.
>       DEF VAR RB-END-PAGE AS INTEGER INITIAL 0.
>       DEF VAR RB-TEST-PATTERN AS LOGICAL INITIAL no.
>       DEF VAR RB-WINDOW-TITLE AS CHARACTER INITIAL "".
>       DEF VAR RB-DISPLAY-ERRORS AS LOGICAL INITIAL yes.
>       DEF VAR RB-DISPLAY-STATUS AS LOGICAL INITIAL yes.
>       DEF VAR RB-NO-WAIT AS LOGICAL INITIAL no.
>       DEF VAR RB-OTHER-PARAMETERS AS CHARACTER INITIAL "".

>     /* 2 */
>       DEF VAR report-list AS CHARACTER.
>       DEF VAR report-count AS INTEGER.
>       DEF VAR report-number AS INTEGER.

>     /* 3 */
>       DEF INPUT PARAMETER report-library AS CHARACTER.

>     /* 4 */
>       RUN aderb/_getname.p (report-library, OUTPUT report-list,
>         OUTPUT report-count).
>     /* 5 */
>       DO report-number = 1 to report-count:

>         RB-REPORT-NAME = entry (report-number, report-list).

>         RUN aderb/_printrb (report-library,
>           RB-REPORT-NAME,
>           RB-DB-CONNECTION,
>           RB-INCLUDE-RECORDS,
>           RB-FILTER,
>           RB-MEMO-FILE,
>           RB-PRINT-DESTINATION,
>           RB-PRINTER-NAME,
>           RB-PRINTER-PORT,
>           RB-OUTPUT-FILE,
>           RB-NUMBER-COPIES,
>           RB-BEGIN-PAGE,
>           RB-END-PAGE,
>           RB-TEST-PATTERN,
>           RB-WINDOW-TITLE,
>           RB-DISPLAY-ERRORS,
>           RB-DISPLAY-STATUS,
>           RB-NO-WAIT,
>           RB-OTHER-PARAMETERS).

>       END.

> The commented numbers correspond to the following step-by-step descriptions:

> 1. Define variables for the report parameters. Note that you must specify each parameter for each report that you run, but that you can assign each parameter a default value for this procedure.

> 2. Define`report-list` and `report-count` for the `_getname.p` output, and `report-number` to keep track of the reports.

> 3. Define input parameter for the library name.

> 4. Run `_getname.p` to access all the reports in the `rbsample.prl` library.

> 5. Print all the reports in the library.

> Note: If you are using the PRNTRB2 interface you must modify the procedure to run `aderb\_prntrb2` and include the `RB-STATUS-FILE` parameter.

Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095