RpReport:PrintPreview() Method

<< Click to Display Table of Contents >>

Navigation:  RpReport Class >

RpReport:PrintPreview() Method

Previous pageReturn to chapter overviewNext page

Purpose

Print the report in the print preview window.

Syntax

<oRpReport>:PrintPreview(                [cJobName],

                                                         [cPrint2File],

         [cCaption],

         [cMessage],

         [lModal],

         [nShowState],

         [lZoomed],

         [symPPWindow])  NIL

Arguments

CJobName

Optional.  The name used for this print job.  This is the name that will be displayed in the Windows Print Manager. This parameter is only used if the user selects the print option from the preview window.

cPrint2Filename

Optional.  The filename to be used if the user selects the Print To File option. This parameter is only used if the user selects the print option from the preview window.

cCaption

Optional.  The caption displayed on the Print Preview window.

cMessage

Optional.  The message string displayed on the dialog window presented to the user during printing.  This parameter is only used if the user selects the print option from the preview window.

lModal

Optional parameter which if TRUE creates the Print Preview as a modal dialog window; FALSE would produce a modeless one.  The default is TRUE.

nShowState

Optional parameter to set the preview window show state.  Valid options are:

SW_SHOWNORMAL, SW_SHOWMAXIMIZED and SW_SHOWMINIMIZED

nZoomed

Optional parameter which specifies the initial zoom level of the Print Preview window.  Valid options are:

ZOOM_WHOLE_PAGE,  ZOOM_PAGE_WIDTH and ZOOM_100

SymPPWindow

Optional parameter to specify a symbol representing a class to instantiate for use as the Print Preview window.   The class specified must provide certain callback methods for ReportPro.  The code for ReportPro's PrintPreview windows is provided as an example of what methods the window needs to provide.  

There are two Print Preview window types provided with ReportPro:

#rpPrintPreviewMDI: this symbol will produce a Print Preview window that is built on an MDI child window.  The owner must be an MDI shell type window.#rpPrintPreviewDLG: this symbol will produce a Print Preview window that is built on a modal or modeless dialog window.

Example

METHOD PreviewReport() CLASS StandardShellWindow

 

LOCAL oReport AS RpReport

LOCAL cJobName, cPrint2Filename, cCaption, cMessage AS STRING

 

oReport := RpReport{SELF, "C:\RP2\BIT.RPT"}

IF oReport:IsValid

 cJobName             := "My Report"

 cPrint2Filename      := "REPORT.PRN"

 cCaption            := "My App Name"

 cMessage            := "Printing in progress..."

 oReport:PrintPreview(cJobName,cPrint2Filename,cCaption,;

                                 cMessage, TRUE)

ENDIF

oReport:Close()