What are you running this under? If it's Win95, I don't think you'll be able
to make the orientation change programmatically in 5.0. Otherwise , look into
printerSetOptions(). Here's some code I use for a similar purpose - perhaps it
will be useful, with some modification. This is in a form used to print a
single envelope, and the code is in the open method of the page. Vars are
declared in the var window (as they are used by both the open and close
methods). Printer in my case is an HP4L.
; Get the current printer settings,
; They will be restored in the page:close method.
liOrientation = recUserOptions.Orientation
liPaperSize = recUserOptions.PaperSize
;If setup is OK for envelopes, exit the method.
if recUserOptions.PaperSize = 20 and recUserOptions.Orientation = 2
loChanged = false
; Specify new printer settings - set size to Com-10 envelope.
recMyOptions.PaperSize = 20
; Set orientation to landscape
recMyOptions.Orientation = 2
if printerSetOptions(recMyOptions) then
message("Printer set for envelopes.")
loChanged = true
loChanged = false
Then to restore the settings:
; If orientation was OK to begin with, exit the method.
if loChanged = false then
; If it was changed, restore it to what it was before the form opened.
recMyOptions.Orientation = liOrientation
recMyOptions.PaperSize = liPaperSize
if not printerSetOptions(recMyOptions) then errorshow() endif
message("Printer settings restored.")
I think you could declare the vars, change the settings, print the report,
then restore the settings, all from your pushbutton method (he said with
RDM Data Solutions
>Using Paradox 5 (maintenance version), I am trying to print envelopes
>to an HP LJ3 from a form. What does work is to pull up the report from
>Project Viewer or whatever and print from it; the printer will ask for
>COM-10s (envelopes). This is good. _But_ I can't call the report from
>a form's pushbutton like:
>It just prints according to the default Windows printer's settings,
>which is usually 8? x 11. Anything I've set in the Report's Page
>Layout doesn't take. Anyone? I've looked at reportPrintInfo stuff, but
>I don't think it's there.