Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

printing reports

Status
Not open for further replies.

D2BEA

Technical User
Mar 13, 2001
41
US
I have written a report to a file and I want to access that file to reprint. It is already in a formatr with headers.
 
D,

what is your question ? And, since anyone answering is going to need it anyway: on what platform are you working, which compiler, etc.

Good luck !
 
If you have already printed something to file, why not just open it with a text editor and print it ??

If you are asking to take an output file which was written to disk and use it as input, that is most likely impossible depending on how the output is. Chris Green
Computer Information Systems Student
Cayuga Community College -- Fulton
 
i have a microfocus compiler and with this there is a command which calls a print command to print the contents of a file.

if the file is already in print format then the ascii codes should already be in there for page breaks, line spacing etc.. therefore printing it out from the compiler or any text editor should do

hope this helps
jimlee(student)
 
what command is it that microfocus uses?
 
This one.....i got this from the online reference with my microfocus compiler. Presumably all compilers will have similar routines???
If you write your print commands to a disk file instead of to the printer using the normal AFTER PAGE/LINE clauses etc then use the routines below, it prints out as normal......



Introduction to Windows Printer Handling Routines

To use the Windows printer handling routines with .int and .gnt code files created using the 16-bit COBOL system, you must load the file mfprnt16.dll before calling any of the routines. You can do this by using the following code in your program:


working-storage section.
01 mfprn-ptr procedure-pointer.
procedure division.
set mfprn-ptr to entry "mfprnt16".


then.....

PC_WIN_PRINT_FILE

Sends the specified file to the printer.


call "PC_WIN_PRINT_FILE" using filename
returning status-code

Parameters:

filename pic x(<n>).
status-code See Key

On Entry:

filename The name of the file to be printed. The name must be space- or null-terminated.

On Exit:

status-code Printer status code:

0 Successful
1 Could not open printer device
3 Printer device not open
4 Out of memory while printing
5 Failed to open file
6 Disk full while spooling file
7 Print job aborted. No file spooled to Print Manager
9 No default printer found. Select a printer from Windows Control Panel.
11 Write failure

Comments:


This routine is available only in the Windows environment.

Example:

To print out the file c:utoexec.bat:


call &quot;PC_WIN_PRINT_FILE&quot;
using by reference &quot;c:utoexec.bat&quot; &x&quot;00&quot;



jimlee jimlee, who is just to take exams, wish me luck!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top