com.crystaldecisions.sdk.occa.report.document
Interface IPageMargins

All Superinterfaces:
IClone
All Known Implementing Classes:
PageMargins

public interface IPageMargins
extends IClone

This interface allows you to get and set the page margins of the report. This information includes: the top, bottom, left, and right margins of the report. These margins are absolute. The right margin is not relative to the left margin and the bottom margin is not relative to the top margin. All margins are measured in twips.


Method Summary
 boolean getAdjustAutomatically()
          For internal use only
 int getBottom()
           Gets the bottom margin of the report.
 int getLeft()
           Gets the left margin of the report.
 PageMarginConditionFormulas getPageMarginConditionFormulas()
           Gets the page margin condition formulas of the report.
 int getRight()
           Gets the right margin of the report.
 int getTop()
           Gets the top margin of the report.
 void setAdjustAutomatically(boolean isAdjustAutomatically)
          For internal use only
 void setBottom(int bottom)
           Sets the bottom margin of the report.
 void setLeft(int left)
           Sets the left margin of the report.
 void setPageMarginConditionFormulas(PageMarginConditionFormulas newFormulas)
           Sets the page margin condition formulas of the report.
 void setRight(int right)
           Sets the right margin of the report.
 void setTop(int top)
           Sets the top margin of the report.
 

Method Detail

getTop

int getTop()

Gets the top margin of the report.

Returns:
the top margin of the report

getBottom

int getBottom()

Gets the bottom margin of the report.

Returns:
the bottom margin of the report

getLeft

int getLeft()

Gets the left margin of the report.

Returns:
the left margin of the report

getRight

int getRight()

Gets the right margin of the report.

Returns:
the right margin of the report

getPageMarginConditionFormulas

PageMarginConditionFormulas getPageMarginConditionFormulas()

Gets the page margin condition formulas of the report. This collection of condition formulas control the width of the page margins.

Returns:
the PageMarginConditionFormulas stored with the report.

getAdjustAutomatically

boolean getAdjustAutomatically()
For internal use only


setTop

void setTop(int top)

Sets the top margin of the report.

Parameters:
top - the top margin of the report

setBottom

void setBottom(int bottom)

Sets the bottom margin of the report.

Parameters:
bottom - the bottom margin of the report

setLeft

void setLeft(int left)

Sets the left margin of the report.

Parameters:
left - the left margin of the report

setRight

void setRight(int right)

Sets the right margin of the report.

Parameters:
right - the right margin of the report

setPageMarginConditionFormulas

void setPageMarginConditionFormulas(PageMarginConditionFormulas newFormulas)

Sets the page margin condition formulas of the report. This collection of condition formulas control the width of the page margins.

Example:

This sample shows how to set a page margin condition formula. The formula checks whether a page number is even or odd and sets the margins accordingly: if the page is an even number, the margin is set to one inch; if the page is an odd number, the margin is set to two inches. The formula is applied to the left margin of the report. For more information on the syntax of conditional formulas please refer to Crystal Reports Online Help.

Use this method if you want to modify multiple print options in a report. For an alternate method see setPageMarginFormula.

 PrintOutputController printOutputController = clientDoc.getPrintOutputController();
 IPrintOptions printOptions = printOutputController.getPrintOptions();
 IPrintOptions newPrintOptions = (PrintOptions)((PrintOptions)printOptions).clone(true);
 IPageMargins newMargins = newPrintOptions.getPageMargins();
 PageMarginConditionFormulas formulas = new PageMarginConditionFormulas();
 IConditionFormula condFormula = new ConditionFormula();
 String formulaText = "If Remainder(pagenumber,2) = 0 then 1440 else 2880";
 condFormula.setSyntax(FormulaSyntax.crystal);
 condFormula.setText(formulaText);
 formulas.setFormula(PageMarginConditionFormulaType.left, condFormula);
 newMargins.setPageMarginConditionFormulas(formulas);
 newPrintOptions.setPageMargins(newMargins);
 printOutputController.modifyPrintOptions(newPrintOptions);
 

Note: There are 1440 twips in an inch.

Parameters:
newFormulas: - page margin condition formulas of the report

setAdjustAutomatically

void setAdjustAutomatically(boolean isAdjustAutomatically)
For internal use only