|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface IPageMargins
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 |
|---|
int getTop()
Gets the top margin of the report.
int getBottom()
Gets the bottom margin of the report.
int getLeft()
Gets the left margin of the report.
int getRight()
Gets the right margin of the report.
PageMarginConditionFormulas getPageMarginConditionFormulas()
Gets the page margin condition formulas of the report. This collection of condition formulas control the width of the page margins.
boolean getAdjustAutomatically()
void setTop(int top)
Sets the top margin of the report.
top - the top margin of the reportvoid setBottom(int bottom)
Sets the bottom margin of the report.
bottom - the bottom margin of the reportvoid setLeft(int left)
Sets the left margin of the report.
left - the left margin of the reportvoid setRight(int right)
Sets the right margin of the report.
right - the right margin of the reportvoid 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.
newFormulas: - page margin condition formulas of the reportvoid setAdjustAutomatically(boolean isAdjustAutomatically)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||