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!

REPORT QUESTION

Status
Not open for further replies.

738262

Programmer
Mar 3, 2002
41
0
0
CY
Hi all.
How can i change the page orieantation programmatically?

Thank you.
 
AFAIF, there isn't really anyway, other than mofifying the report like a table at run-time:
Code:
use myReport.frx exclusive
And changing the information in record one, in the Expr field (the one that contains the printer information), for example:
DRIVER=winspool
DEVICE=Canon BJC-2000
OUTPUT=LPT1:
ORIENTATION=0
PAPERSIZE=1
PAPERLENGTH=2794
PAPERWIDTH=2159
DEFAULTSOURCE=1
COLOR=2
TTOPTION=1

Changing the ORIENTATION from 0 to 1, close your report and use your regular REPORT FORM ....
 
Thank you mgagnon for your reply.
I have the following problem in one of my reports. I have set the orientation in landscape from the report designer.
If I preview the report in the command window it displays in landscape. Now if i preview the report in my application it displays in potrait. Can anyone help with that problem?

Thank you.
 
Dear All,

One method to choose the orientation, is as follows:

Setup two printer driver for same printer.
Rename one of the driver to include "PORTRAIT" and rename other driver to include "LANDSCAPE". Set page orientation for each driver as per the name given.

In your application, before printing any report, select the default printer as whichever printer drive you want to use.
System will use the driver's page orientation and your report will work accordingly.

Note: Whenever you edit any report form in VFP, it saves the current default printer detail in the first record of the report form. The printer on your development machine might be different from the printer on final machine where app will run. So, you should strip this information from the report form file, otherwise your report will behave wierdly. Write a short program to searh for all *.frx file, USE it and REPLace EXPR with "", TAG with "", TAG2 with "" in first record.

To my knowledge, there is no other setting in VFP reporting option to choose page orientation.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top