Skip to content

DFSetPrintDlgInPreview - cWinReport2

Determines if the print job dialog will appear when printing is selected from the WinPrint2 viewer

Type: Procedure

Parameters

Parameter Type Description
bShowDialog Boolean True if print job dialog should appear, false if dialog will not appear

Syntax

Procedure DFSetPrintDlgInPreview Boolean bShowDialog

Call Example

Send DFSetPrintDlgInPreview bShowDialog

Description

DFSetPrintDlgInPreview allows the developer to control if the print job dialog will appear when the print buttom is selected from the WinPrint2 viewer. When a report is started, the report object always enables the print job dialog. This capability may be disabled by sending the DFSetEnablePrintFromPreview message. This message should be sent from inside of the starting_main_report event.

The Print Job dialog allows you to set a report's page range, number of copies, and collation. It is usually invoked after a report has been generated before printing. This dialog will appear from the report viewer unless the feature is disabled using the DFSetPrintDlgInPreview message. It can be invoked when printing manually using the DFPrint message which will invoke the dialog, print the report and then clear the report document. It can be invoked by itself with the DFPrintDialog message.

Function Starting_Main_Report Returns Integer
    Boolean bErr
    Send DFSetMetrics wpm_cm
    Send DFSetmargins 1 1 1 1
    Send DFSetPrintDlgInPreview  False // Don't show the print job dialog when you select print from the viewer
    Forward Get Starting_Main_Report to bErr
    Function_return bErr
End_Function // Starting_Main_Report

The DFGet and DFSet messages and the WinPrint2 global object.

All of the cWinReport2 DFGet... and DFSet... messages set the state of the global WinPrint2 report object (the WinPrint2 report engine). It is not setting the state of the report object (i.e., these methods are not setting report object properties). Since many reports in an application will use the global WinPrint2 object, you must set and get the state of this object when your report object has control of it. The best place to do this is inside of the Starting_main_report event.

See Also

DFGetPrintDlgInPreview | DFGetEnablePrintFromPreview | DFSetEnablePrintFromPreview | DFPrint | DFPrintDialog