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

Landscape printing

Status
Not open for further replies.

JackTheC

Programmer
Feb 25, 2002
325
NL
Besides working with reports in VFP 3.0b, I sometimes like to print directly with
SET PRINT ON
SET PRINTER FONT "ARIAL" , 14
? "Something"
SET PRINT OFF
SET PRINTER TO DEFAULT.
This works fine in portrait printing. But I can't figure out how to print in landscape that way.
There are two situations possible:
A. I do know which printer is being used (e.g. HP laserjet)
B. I don't know which printer the end-user has available.
Even in situation A. the ???-command doesn't seem to work properly.
Who can help me?

 
Perhaps it would help you to transfer your data which has to be print
into a report created with the reporting-assistent (it is part of VFP).
At least in Version 5 the assistent will ask you for the style of orientation and offers
Landscape or Portrait.
I think this had been in Version 3 too.

Sorry, for my English, have no better idea.
Greatings from Germany

Klaus
 
In situation A, you also need:

SET PRINTER TO NAME NameOfPrinter
SET PRINT ON
SET DEVICE TO PRINT
SET PRINTER FONT "ARIAL" , 14
??? "Something"
SET PRINT OFF
SET PRINTER TO
SET DEVICE TO SCREEN

commands to make it work.

As for the other stuff, you can use APRINTERS() or GETPRINTER() to use the printer they have installed. But you need to know the control codes of those printers, and place those codes in your print routine in order to switch to landscape mode on them.

Dave S.
 
For HP LaserJet and landscape, try
??? chr(27)+"&l1O"
 
Dear German121,
As I mentioned, I am looking for a way other than reports.

Dear DSummZZZ,
SET DEVICE TO is only needed with @ commands not with ?.
SET PRINTER TO NAME is only needed when printing on a non-default printer.

Dear Tesar,
I already had tried that, that's the reason I mentioned the HP 5 Laserjet, but
1. I get a blank page first
2. Selecting fonts (in this example Arial 14) does not work.

The only thing I can come up with for situation A is:
SET PRINTER TO FILE.TXT
SET PRINT ON
? ALL THE NECESSARY HP ESCAPE SEQUENCES
? "SOMETHING"
SET PRINT OFF
SET PRINTER TO
COPY FILE FILE.TXT TO LPT1
(or getprinter() or \\servername\printername)

But, of course, this does not work when another printer than HP is used.
 
Hi JackTheC (Visitor),

I have been asking the same kind of help (and I think I am
in the same trouble as you are: you are trying to manipulate
the printer through your program and not through any
interactive menu or stupid report, right?? ) but within the
last two months, I am still stuck. Pity on both of us. All I
can do is to create several printer for different setups /w the
same driver. Da**..... But that won't last long when printing
style is going to vary more & more....
 
Hi softlab,

You're absolutely right. Sometimes the output is so complicated that reports can't do the job. Reports are wonderful stuff, but not allways. In Foxbase (dos) printing landscape was easy:

Set print on
? escape codes depending on printertype
? something
set print off

But, since Windows uses the built-in printerdrivers, these old solutions won't work anymore. So I'm looking for an easy way to achieve the same results. Installing more printers with different properties was my first idea too. Back in 1997. But that's so hard to explain to other users in- and outside our company. Especially since end-users have no access to printer-properties in our company. We depend on the good will of an IT-company for that matter.
 
Hi JackTheC (Visitor)

I started the window migration just in Sep 2000. Before then I
was doing the Y2K compliance. All applications were under
window-dos but we still have trouble with memory managment.
(Either window problem or the dos window problem as we are
running a chinese dos window and those guys did not make a
good one.) Knowing that somebody got stuck for 5 years surely
ease off my pain for being stuck for 2 (just joking). Anyway,
if any solution pops up or something worth sharing, you like to
share with us? softlabhk@citymail.com.tw
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top