Skip to content

DFSetEnablePrintFromPreview - cWinReport2

Determines if WinPrint2 viewer allows printing

Type: Procedure

Parameters

Parameter Type Description
bEnablePrint Boolean If true, printing from viewer is allowed. If false, printing from viewer is not allowed

Syntax

Procedure DFSetEnablePrintFromPreview Boolean bEnablePrint

Call Example

Send DFSetEnablePrintFromPreview bEnablePrint

Description

When a report is started, the report object always enables printing from the viewer. This capability may be disabled by sending the DFSetEnablePrintFromPreview. This message should be sent from inside of the starting_main_report event.

Function Starting_Main_Report Returns Integer
    Boolean bErr
    Send DFSetMetrics wpm_cm
    Send DFSetmargins 1 1 1 1
    Send DFSetEnablePrintFromPreview False // disable printing from the viewer.
    Forward Get Starting_Main_Report to bErr
    Function_return bErr
End_Function // Starting_Main_Report

When disabled, the print button in the viewer will appear as a disabled button.

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

DfGetEnablePrintFromPreview