Skip to content

DFSetTopBottom - cWinReport2

Sets the top and bottom margins used by the Page_Top and Page_Bottom sections

Type: Procedure

Parameters

Parameter Type Description
nTop Number Top Margin
nBottom Number Bottom Margin
bAllPages Boolean Apply to all pages (or only to first/last)

Syntax

Procedure DFSetTopBottom Number nTop Number nBottom Boolean bAllPages

Call Example

Send DFSetTopBottom nTop nBottom bAllPages

Description

DFSetTopBottom sets the top margin for Page_Top and the bottom margin for Page_Bottom. If these margins are not set the absolute page margin as determined by the selected printer is used.

The pAllPages parameter is used to determine if the margin setting should be applied to all pages (the default) or just the first page (for page_top) and that last page (for page_bottom).

The left/right margins, and top/bottom margins for all other sections are set using the DFSetMargins message.

Function Starting_Main_Report Returns Integer
    Boolean bErr

    Send DFSetMetrics wpm_cm
    Send DFSetMargins 1 2 1 3
    Send DFSetTopBottom  1 1 True
    Send DFSetLandscape True
    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

DFSetMargins