Consultor Eletrônico



Kbase P109792: How to print a report and export it to a file at the same time with Report Builder
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   11/10/2005
Status: Unverified

GOAL:

How to print a report and export it to a file at the same time with Report Builder

GOAL:

Is it possible to print a report and export it to a file from a single call to a Report Engine interface?

FIX:

This can only be done with 2 calls to a Report Engine Interface (PrintRB, PrntRB2, Table), with 1 call for the print job and 1 call for the export to file.

The following code provides a simple example of how to achieve this.
In the first iteration of the DO block, the report is exported to a file.
In the second iteration of the DO block, the report is printed normally.

/* Sample Code for the PrintRB Interface */
DEFINE VARIABLE i AS INTEGER NO-UNDO.
DEFINE VARIABLE rbOutPut AS CHARACTER NO-UNDO.
DEFINE VARIABLE rbDest AS CHARACTER NO-UNDO.
DO i = 1 TO 2:
IF i = 1 THEN
DO:
ASSIGN rbDest = "A"
rbOutPut = "C:\temp\rb.txt"
.
END.
ELSE
DO:
ASSIGN rbDest = ""
rbOutPut = ""
.
END.

RUN aderb\_printrb(
"<Path to Progress Report Library>", /* RB-REPORT-LIBRARY */
"<Report Name>", /* RB-REPORT-NAME */
"", /* RB-DB-CONNECTION */
"", /* RB-INCLUDE-RECORDS */
"", /* RB-FILTER */
"", /* RB-MEMO-FILE */
rbDest, /* RB-PRINT-DESTINATION */
"<Printer Name>", /* RB-PRINTER-NAME */
"", &n.bsp; /* RB-PRINTER-PORT */
rbOutput, /* RB-OUTPUT-FILE */
0, /* RB-NUMBER-COPIES - zero */
0, /* RB-BEGIN-PAGE - zero */
0, /* RB-END-PAGE - zero */
no, /* RB-TEST-PATTERN */
"", /* RB-WINDOW-TITLE */
yes, /* RB-DISPLAY-ERRORS */
yes, /* RB-DISPLAY-STATUS */
no, /* RB-NO-WAIT */
""). /* RB-OTHER-PARAMETERS */
END..