DFSetMargins - cWinReport2
Sets Left, Top, Right and Bottom Margins for a report
Type: Procedure
Parameters
| Parameter | Type | Description |
|---|---|---|
| nLeft | Number | Left Margin |
| nTop | Number | Top Margin |
| nRight | Number | Right Margin |
| nBottom | Number | Bottom Margin |
Syntax
Procedure DFSetMargins Number nLeft Number nTop Number nRight Number nBottom
Call Example
Send DFSetMargins nLeft nTop nRight nBottom
Description
DFSetMargins sets margins in your report using the report's current metrics. This method is normally sent inside of Starting_Main_Report
Function Starting_Main_Report Returns Integer
Boolean bErr
Send DFSetMetrics wpm_cm
Send DFSetmargins 1 1 1 1
Send DFSetLandscape true
Forward Get Starting_Main_Report to bErr
Function_return bErr
End_Function // Starting_Main_Report
Setting any value to 0, tells the report to use the physical page margin as specified by the printer. If you specify a margin value that is less than the physical margin value, the physical page margin is used (i.e., same as using 0).
The left and right margins are used for all sections of a report. The top and bottom margins apply to all sections except Page_Top and Page_Bottom. Page_Top and Page_Bottom sections use the actual physical top and bottom page margins for whatever printer is selected. Page_Top and Page_Bottom margins can be set using the DFSetTopBottom message.
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