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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing using FoxPro 2.x style commands in VFP 6.0 2

Status
Not open for further replies.

michel392

Programmer
Dec 17, 2001
54
BR
Dear colleagues:

I need to know (always using commands in programs, like the example bellow):

1) How to say the printer (whatever it is, Epson dot matrix, HP Injket, HP Laser, etc) to print in NORMAL characters and in COMPACT characters.

2) Is it possible to give the operator, when he is executing the program, the OPTION TO CHOOSE THE PRINTER (in the network) he wants to send the report to, like that print option window which opens when we ask MS Word to print something ?

In my FoxPro 2.0 DOS programs I used the commands to print a report:

* REPORT1.PRG
*
CLEAR
SET DEVICE TO PRINT
@ 1, 1 SAY CHR(10) && normal characters (Epson dot matrix)
@ 2, 1 SAY "MONTHLY REPORT"
@ 3, 1 SAY CHR$15) && compact characters (Epson dot matrix)
@ 4, 1 SAY "SALES JAN FEB MAR APR MAI JUN JUL"
@ 5, 1 SAY ....
.
.
.
EJECT
SET DEVICE TO SCREEN
RETURN


Thanks for your help.
Michel


 
In windows, you no longer can control the printer outside of the windows printer drivers. All @ Say's to the printer are processed using VFP through the windows printer driver; You can control the font with SET PRINTER FONT cfontname,nPointSize

You may want to explore using Winprint ( ), which takes simple text files and processes them, providing a print preview, and giving a "Print" button to send the report to any windows printer. The text files can contain {CPI10} {CPI12} {CPI17} commands, along with many other font, line draw, shape, etc. commands.
 

2. Is it possible to give the operator, when he is executing the program, the OPTION TO CHOOSE THE PRINTER (in the network) he wants to send the report to, like that print option window which opens when we ask MS Word to print something ?


SET DEVICE TO PRINTER PROMPT

 
changing the print size from compressed to noraml requires to have the printer codes for that printer.

with that aside, why is anyone printing this old way. I have not come accross anything that I could not do with report writer. other then when I needed OLE with other windows programs, all my printing needs are met with the report writer. Attitude is Everything
 
The first biggest reason to ever do things this way is when you're converting a foxpro dos or foxwin 2.6 program that already has 100's of hand-coded reports. Using WinPrint as a shim is a quick way to make them all work in Windows.

The other reason I personally like it is that you can draw circles/ovals and polygons on the report; Put colored backgrounds on fonts, including hatched backgrounds; rotate fonts to any angle; draw lines at angles other than 90deg; use ASCII line draw chars; And save generated reports for printing later.

But, then, I'm prejudiced, because I wrote it.
- Bill
 
I use RAWPRINT.FLL to accomplish this. You set your printer to a text file and then use rawprint to send the file directly to the windows printer, bypassing the windows printer driver.

If you need code examples I would be happy to provide them.

I think I found RAWPRINT on the Universal Thread
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top