RPV Reports / Usage Examples
 
Search in RpvSoftware.com
Go!                                         English    Español

What Rpv is

Rpv Reports 2024

Downloads

Training/Consultancy

Support

Purchase

Contact

 
Home > Usage Examples > Cobol Examples
How to adapt your existing COBOL programs
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.
- Preview it
- Send it to the printer

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 a specific directory searching for reports and, when it finds one it sends it directly to printer.
How to start Rpv in server mode

Home
What Rpv is
Rpv Reports 2024

Products
Rpv Reports 2024
Personalized edition

More...
Downloads
Support
Rpv Reports Online help
Rpv Visual Editor online help
Examples
/temp section
Videos




Copyright (c) 2001-2024 - Rpv Software. All rights reserved.