|
Begin in five
minutes. Adapting your existing COBOL programs.
You can obtain a graphical printout
using your COBOL & RPV in no more than five minutes.
Since Rpv works reading plain text files, first thing that we will need
is to redirect the report to a file instead to send it directly to the
printer.
| |
SELECT REPORT-OUT
ASSIGN TO PRINTER
"C:\MYREPORTS\FIRSTREP.TXT"
FILE STATUS IS
STATUS-PRN. |
|
|
What we just saw will create the file C:\MYREPORTS\FIRSTREP.TXT
on the disk instead sending it to printer.
After that, run you program and test it opening the output file
FIRSTREP.TXT with the Rpv report viewer. Make sure that your program
closes the file before Rpv opens it.
It could happen that everything looks like you need, specially if you
are not inserting many ESC commands into your reports to change the
fonts.
In that case, you must decide what
your program will to do with the report after it is generated.
The most used option is to
preview it. However, if your COBOL does not work on Windows (MS-DOS for
example), many programmers will not want the end user sees how the
program "jumps" to a graphical interface (DOS to WINDOWS).
In any case, if you need to preview
your report just call Rpv FIRSTREP.TXT to preview it, giving end users
the ability to decide to print it or not.
How to preview it from
your program.
| |
CALL 'SYSTEM'
USING
"RPV C:\MYREPORTS\FIRSTREP.TXT" |
How to call Rpv.exe from
Rm/Cobol to preview your report. |
|
How to print it from your
program without preview.
There are two different ways to send
a report to printer: the "RPVPRINT.EXE" and "print server".
For those COBOLs running on
DOS/WINDOWS, the best option is RPVPRINT.EXE because it sends the file
directly to printer without preview and without "jumping" to graphical
environment.
Rpvprint.exe
Just call RPVPRINT.EXE like you call
RPV.EXE for previewing your report.
| |
CALL 'SYSTEM'
USING
"RPVPRINT.EXE
C:\MYREPORTS\FIRSTREP.TXT" |
|
|
Rpv Print Server
To print with Rpv Print Server is a
little bit different since Rpv in server mode must be already running.
Rpv in server mode is a program that examines an specific directory
searching for reports and, when it finds one it sends it directly to
printer. See:
How to start Rpv in server mode (new window)
|