Help: Retaining Report Page Layout When Calling Report From Form

Help: Retaining Report Page Layout When Calling Report From Form

Post by David Kessl » Tue, 21 May 1996 04:00:00



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:

        report.print("report.rdl")

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.

 
 
 

Help: Retaining Report Page Layout When Calling Report From Form

Post by Robert D. Mart » Wed, 22 May 1996 04:00:00


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.

        Var
                liOrientation,
                liPaperSize             LongInt
                recUserOptions,
                recMyOptions            PrinterOptionInfo
                loChanged                   Logical
        endVar

        ; Get the current printer settings,
        ; They will be restored in the page:close method.
        printerGetOptions(recUserOptions)
        liOrientation = recUserOptions.Orientation
        liPaperSize = recUserOptions.PaperSize

        ;If setup is OK for envelopes, exit the method.
        if recUserOptions.PaperSize = 20 and recUserOptions.Orientation = 2    
     then
                loChanged = false
                return
        endif

        ; 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
        else
                errorShow()
                loChanged = false
        endif

Then to restore the settings:
        ; If orientation was OK to begin with, exit the method.
        if loChanged = false  then
                        return
        ; If it was changed, restore it to what it was before the form opened.
        else
                recMyOptions.Orientation = liOrientation
                recMyOptions.PaperSize = liPaperSize
                if not printerSetOptions(recMyOptions) then errorshow() endif
                message("Printer settings restored.")
        endif

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
fingers crossed).

HTH,
Bob Martin
RDM Data Solutions



Quote:>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:

>        report.print("report.rdl")

>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.


 
 
 

1. need help saving page layout info for reports

I am having no luck in getting paradox reports to retain page layout
information.  For exmaple, I have a report which I want to run with an
envelope feeder, a specific media size, etc.  I save all this
information (while in design mode) via page layout.  When I run the
report, the layout information is based on whatever the current system
settings are.  The only way I can get this to work is to open the
report for design, modify page layout, then run the report.

I can't seem to get any help from the manuals and there is some step
I'm missing.  Any help would be appreciated.

running paradox for windows 5.0 on windows 3.1.

Chris Fitzgerald

2. Connection manager (setup error)

3. Report page number across multiple report forms

4. How to prevent tempdb filling up

5. page layout for reports

6. Accesing Sybase (NT) from Unix stations

7. Setting page layout in Data Report

8. page layout, graphics to printers from i4gl reports.

9. FPW26: Other report layout on second page

10. Report Page LayOut Problem

11. Help Needed in VFP-Report Form.Page should not eject

12. FPW 2.6 - reports: page layout