|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.crystaldecisions.sdk.occa.report.document.PageMargins
public class PageMargins
This object 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.
Use IPageMargins to access these methods.
| Constructor Summary | |
|---|---|
PageMargins()
|
|
PageMargins(IPageMargins src)
|
|
| Method Summary | |
|---|---|
java.lang.Object |
clone(boolean deepClone)
|
void |
copyTo(java.lang.Object destObject,
boolean deepCopy)
|
java.lang.Object |
createMember(java.lang.String eleName,
org.xml.sax.Attributes attrs,
XMLSerializationContext ctxt,
java.util.Map objState,
boolean[] bLoaded)
For internal use only. |
void |
endElement(java.lang.String eleName,
java.util.Map objState)
For internal use only. |
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. |
boolean |
hasContent(java.lang.Object srcPageMargins)
|
void |
readElement(java.lang.String eleName,
java.lang.String sVal,
org.xml.sax.Attributes attrs,
java.util.Map objState)
For internal use only. |
void |
save(XMLWriter writer,
java.lang.String sTag,
XMLSerializationContext ctxt)
For internal use only. |
void |
save(XMLWriter writer,
XMLSerializationContext ctxt)
For internal use only. |
void |
saveContents(XMLWriter writer,
XMLSerializationContext ctxt)
For internal use only. |
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. |
void |
startElement(java.lang.String eleName,
java.util.Map objState,
org.xml.sax.Attributes attrs)
For internal use only. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PageMargins(IPageMargins src)
public PageMargins()
| Method Detail |
|---|
public java.lang.Object clone(boolean deepClone)
public boolean hasContent(java.lang.Object srcPageMargins)
public void copyTo(java.lang.Object destObject,
boolean deepCopy)
public int getTop()
IPageMarginsGets the top margin of the report.
getTop in interface IPageMarginspublic int getBottom()
IPageMarginsGets the bottom margin of the report.
getBottom in interface IPageMarginspublic int getLeft()
IPageMarginsGets the left margin of the report.
getLeft in interface IPageMarginspublic int getRight()
IPageMarginsGets the right margin of the report.
getRight in interface IPageMarginspublic PageMarginConditionFormulas getPageMarginConditionFormulas()
IPageMarginsGets the page margin condition formulas of the report. This collection of condition formulas control the width of the page margins.
getPageMarginConditionFormulas in interface IPageMarginspublic boolean getAdjustAutomatically()
IPageMargins
getAdjustAutomatically in interface IPageMarginspublic void setTop(int top)
IPageMarginsSets the top margin of the report.
setTop in interface IPageMarginstop - the top margin of the reportpublic void setBottom(int bottom)
IPageMarginsSets the bottom margin of the report.
setBottom in interface IPageMarginsbottom - the bottom margin of the reportpublic void setLeft(int left)
IPageMarginsSets the left margin of the report.
setLeft in interface IPageMarginsleft - the left margin of the reportpublic void setRight(int right)
IPageMarginsSets the right margin of the report.
setRight in interface IPageMarginsright - the right margin of the reportpublic void setPageMarginConditionFormulas(PageMarginConditionFormulas newFormulas)
IPageMarginsSets 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.
setPageMarginConditionFormulas in interface IPageMarginspublic void setAdjustAutomatically(boolean isAdjustAutomatically)
IPageMargins
setAdjustAutomatically in interface IPageMargins
public void readElement(java.lang.String eleName,
java.lang.String sVal,
org.xml.sax.Attributes attrs,
java.util.Map objState)
For internal use only.
public void save(XMLWriter writer,
XMLSerializationContext ctxt)
throws java.io.IOException
For internal use only.
java.io.IOException
public void save(XMLWriter writer,
java.lang.String sTag,
XMLSerializationContext ctxt)
throws java.io.IOException
For internal use only.
java.io.IOException
public void saveContents(XMLWriter writer,
XMLSerializationContext ctxt)
throws java.io.IOException
For internal use only.
java.io.IOException
public java.lang.Object createMember(java.lang.String eleName,
org.xml.sax.Attributes attrs,
XMLSerializationContext ctxt,
java.util.Map objState,
boolean[] bLoaded)
For internal use only.
public void endElement(java.lang.String eleName,
java.util.Map objState)
For internal use only.
public void startElement(java.lang.String eleName,
java.util.Map objState,
org.xml.sax.Attributes attrs)
For internal use only.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||