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

Printing in landscape orientation in VFP by programming 1

Status
Not open for further replies.

Nabarun

Programmer
Jul 24, 2021
7
0
0
IN
Could anyone help me to print a dbf in landscape orientation in VFP?
 
There are two solutions (if not more).

While in report designer open up properties and there click on page setup to pick landscape.
You then have to save printer environment, otherwise that landscape setting isn't kept in the FRX.

This has a downside, you save other printer environment settings, too and that may make a report less portable to any other printer. Therefore a solution not only for this but also other settings of a printer is to install the printer multiple times, give the printer installation a speaking name - for illustration purposes EpsonPhotopaperTrayLandscape and set this settings of this specific printer instance within Windows, ie a paper tray with photo paper and the landscape setting.

This is widely used as the simplest solution even to complicated settings, as the printer driver knows best how to set up the printer and so that's off your shoulders. As you can install a printer many times you can set all necessary options even more than the printer dialog VFP calls offers and Windows printer API then takes care of all that. All you need in your report then is a print area width and height matching the expected paper size and SET PRINTER TO NAME YourdeesiredPrinterAndConfiguration before the REPORT FORM call.

Chriss

PS: With the second solution obviously you don't save printer environment with the report. If you just do this for yourself the first solution is simple enough, but to manage multiple settings the second solution still is fine even just for yourself. The only annoyance is when you have many trays and want to have any possible setting combination you would need to set up a lot of instances of it. Usually you only need a few settings, though.
 
Hello,

you can test as follows :
Make a copy of your report
open it with use yourreport.frx
browse
in Record 1 check expr field, ORIENTATION = 1 for landscape or 0 for portrait (Save record changes with STRG+W)

regards
tom

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top