Skip to content

DFGetLandscape - cWinReport2

Determines if a report page orientation should be Landscape or Portrait

Type: Function
Return Data Type: Boolean

Syntax

Function DFGetLandscape Returns Boolean

Call Example

Get DFGetLandscape to BooleanVariable

Description

The DFGetLandscape function returns true if the report's orientation is landscape. You must specify a report's orientation before running a report. This can be done by the user using the printer set up dialog or this can be set by the developer using the DFSetLandscape message.

Function Starting_Main_Report Returns Integer
    Boolean bErr bLandscape
    Get DFGetLandscape to bLandscape
    If not bLandscape begin
        Error DFERR_OPERATOR "Report cannot be printed in portrait mode. Please change"
    end
    else begin
        Send DFSetMetrics wpm_cm
        Send DFSetmargins 1 1 1 1
        Forward Get Starting_Main_Report to bErr
    end
    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

DFSetLandscape

Return Value

Returns True if output orientation is Landscape, false if portrait