Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Printing using generic / text only printer
Message
From
13/03/2009 07:36:50
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
12/03/2009 16:46:26
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01387345
Message ID:
01387617
Views:
58
>Hilmar:
>
>I have since solved the above problem, but I still have a problem, as I'll now describe:
>
>The Clipper program which I'm working with, which was designed for DOS, prints to the DOS printer thus:
>
>
>set device to printer
>@ 0,1 say ' '
>llFirstTime = .t.
>use SomeTable
>Do while !eof()
>  If llFirstTime
>    Do PrintHeader  
>    llFirstTime = .f.
>  endif
>  If prow() > 55
>    do Printerfooter  && which at the end issues an EJECT command
>  @ prow() + 1 say Field1 + ' ' + field2
>  skip
>enddo
>
>set device to screen
>
>return
>
>proc printheader
>
>@ 0,1 say wierd characters that resolve to nice lines in the DOS world
>
>return
>
>
>To get around the wierd characters, I bought HVTerminal fonts from a company in Australia, created an FRX file that has one field in it with the HVTerminal font, and changed the above program to SET DEVICE to file joe.txt.
>
>I then execute the following code:
>
>
>SET DEVICE TO SCREEN
>
>CREATE CURSOR joeCursor  ;
>	(cDetail c(250))
>
>APPEND FROM joe.txt TYPE SDF 
>
>IF RECCOUNT() > 0
>	REPORT FORM joetest NOCONSOLE PREVIEW 
>ENDIF
>
>
>
>The problem that I still have:
>
>1. In order to make the page eject, I need a routine to print a bunch of blank lines until the page ejects, since printing EJECT to the file doesn't accomplish this, but this seems to be PRINTER SPECIFIC. How do I get around this? This needs to work with multiple printers.
>
>2. If I don't save the printer environment, how would that help? How would the report work with all printers?
>
>I hope I explained myself properly.
>
>Thanks,
>
>Yossi

To make a report print as in DOS, I would create a text file and then print the entire file with the command "???", thusly:
lcPrinterSetupCodes = ...
lcFileInRam = FileToStr("FileOnDisk.txt")
??? lcPrinterSetupCodes + lcFileInRam
My reporting class does something similar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform