PageSetup

Inheritance: java.lang.Object

public class PageSetup

Encapsulates the object that represents the page setup description. The PageSetup object contains all page setup options.

Example

         Workbook workbook = new Workbook();
 
         WorksheetCollection sheets = workbook.getWorksheets();
 
         //Add a worksheet
         sheets.add();
         Worksheet sheet = sheets.get(1);
         PageSetup pageSetup = sheet.getPageSetup();
         pageSetup.setPrintArea("D1:K13");
 
         //do your business

Methods

MethodDescription
clearHeaderFooter()Clears header and footer setting.
copy(PageSetup source, CopyOptions copyOptions)Copies the setting of the page setup.
customPaperSize(double width, double height)Sets the custom paper size, in unit of inches.
equals(Object arg0)
getBlackAndWhite()Represents if elements of the document will be printed in black and white.
getBottomMargin()Represents the size of the bottom margin, in unit of centimeters.
getBottomMarginInch()Represents the size of the bottom margin, in unit of inches.
getCenterHorizontally()Represent if the sheet is printed centered horizontally.
getCenterVertically()Represent if the sheet is printed centered vertically.
getClass()
getCommands(String headerFooterScript)Gets all commands of header or footer.
getEvenFooter(int section)Gets a script formatting the even footer of an Excel file.
getEvenHeader(int section)Gets a script formatting the even header of an Excel file.
getFirstPageFooter(int section)Gets a script formatting the first page footer of an Excel file.
getFirstPageHeader(int section)Gets a script formatting the first page header of an Excel file.
getFirstPageNumber()Represents the first page number that will be used when this sheet is printed.
getFitToPagesTall()Represents the number of pages tall the worksheet will be scaled to when it’s printed.
getFitToPagesWide()Represents the number of pages wide the worksheet will be scaled to when it’s printed.
getFooter(int section)Gets a script formatting the footer of an Excel file.
getFooterMargin()Represents the distance from the bottom of the page to the footer, in unit of centimeters.
getFooterMarginInch()Represents the distance from the bottom of the page to the footer, in unit of inches.
getHeader(int section)Gets a script formatting the header of an Excel file.
getHeaderMargin()Represents the distance from the top of the page to the header, in unit of centimeters.
getHeaderMarginInch()Represents the distance from the top of the page to the header, in unit of inches.
getLeftMargin()Represents the size of the left margin, in unit of centimeters.
getLeftMarginInch()Represents the size of the left margin, in unit of inches.
getODSPageBackground()Gets the background of ODS.
getOrder()Represents the order that Microsoft Excel uses to number pages when printing a large worksheet.
getOrientation()Represents page print orientation.
getPaperHeight()Gets the height of the paper in unit of inches , considered page orientation.
getPaperSize()Represents the size of the paper.
getPaperWidth()Gets the width of the paper in unit of inches, considered page orientation.
getPicture(boolean isFirst, boolean isEven, boolean isHeader, int section)Gets the Picture object of the header / footer.
getPicture(boolean isHeader, int section)Gets the Picture object of the header / footer.
getPrintArea()Represents the range to be printed.
getPrintComments()Represents the way comments are printed with the sheet.
getPrintCopies()Gets number of copies to print.
getPrintDraft()Represents if the sheet will be printed without graphics.
getPrintErrors()Specifies the type of print error displayed.
getPrintGridlines()Represents if cell gridlines are printed on the page.
getPrintHeadings()Represents if row and column headings are printed with this page.
getPrintQuality()Represents the print quality.
getPrintTitleColumns()Represents the columns that contain the cells to be repeated on the left side of each page.
getPrintTitleRows()Represents the rows that contain the cells to be repeated at the top of each page.
getPrinterSettings()Gets the settings of the default printer.
getRightMargin()Represents the size of the right margin, in unit of centimeters.
getRightMarginInch()Represents the size of the right margin, in unit of inches.
getTopMargin()Represents the size of the top margin, in unit of centimeters.
getTopMarginInch()Represents the size of the top margin, in unit of inches.
getZoom()Represents the scaling factor in percent.
hashCode()
isAutoFirstPageNumber()Indicates whether the first the page number is automatically assigned.
isAutomaticPaperSize()Indicates whether the paper size is automatic.
isHFAlignMargins()Indicates whether header and footer margins are aligned with the page margins.
isHFDiffFirst()True means that the header/footer of the first page is different with other pages.
isHFDiffOddEven()True means that the header/footer of the odd pages is different with odd pages.
isHFScaleWithDoc()Indicates whether header and footer are scaled with document scaling.
isPercentScale()If this property is False, the FitToPagesWide and FitToPagesTall properties control how the worksheet is scaled.
notify()
notifyAll()
setAutoFirstPageNumber(boolean value)Indicates whether the first the page number is automatically assigned.
setBlackAndWhite(boolean value)Represents if elements of the document will be printed in black and white.
setBottomMargin(double value)Represents the size of the bottom margin, in unit of centimeters.
setBottomMarginInch(double value)Represents the size of the bottom margin, in unit of inches.
setCenterHorizontally(boolean value)Represent if the sheet is printed centered horizontally.
setCenterVertically(boolean value)Represent if the sheet is printed centered vertically.
setEvenFooter(int section, String footerScript)Sets a script formatting the even page footer of an Excel file.
setEvenHeader(int section, String headerScript)Sets a script formatting the even page header of an Excel file.
setFirstPageFooter(int section, String footerScript)Sets a script formatting the first page footer of an Excel file.
setFirstPageHeader(int section, String headerScript)Sets a script formatting the first page header of an Excel file.
setFirstPageNumber(int value)Represents the first page number that will be used when this sheet is printed.
setFitToPages(int wide, int tall)Sets the number of pages the worksheet will be scaled to when it’s printed.
setFitToPagesTall(int value)Represents the number of pages tall the worksheet will be scaled to when it’s printed.
setFitToPagesWide(int value)Represents the number of pages wide the worksheet will be scaled to when it’s printed.
setFooter(int section, String footerScript)Sets a script formatting the footer of an Excel file.
setFooterMargin(double value)Represents the distance from the bottom of the page to the footer, in unit of centimeters.
setFooterMarginInch(double value)Represents the distance from the bottom of the page to the footer, in unit of inches.
setFooterPicture(int section, byte[] footerPicture)Sets an image in the footer of a worksheet.
setHFAlignMargins(boolean value)Indicates whether header and footer margins are aligned with the page margins.
setHFDiffFirst(boolean value)True means that the header/footer of the first page is different with other pages.
setHFDiffOddEven(boolean value)True means that the header/footer of the odd pages is different with odd pages.
setHFScaleWithDoc(boolean value)Indicates whether header and footer are scaled with document scaling.
setHeader(int section, String headerScript)Sets a script formatting the header of an Excel file.
setHeaderMargin(double value)Represents the distance from the top of the page to the header, in unit of centimeters.
setHeaderMarginInch(double value)Represents the distance from the top of the page to the header, in unit of inches.
setHeaderPicture(int section, byte[] headerPicture)Sets an image in the header of a worksheet.
setLeftMargin(double value)Represents the size of the left margin, in unit of centimeters.
setLeftMarginInch(double value)Represents the size of the left margin, in unit of inches.
setOrder(int value)Represents the order that Microsoft Excel uses to number pages when printing a large worksheet.
setOrientation(int value)Represents page print orientation.
setPaperSize(int value)Represents the size of the paper.
setPercentScale(boolean value)If this property is False, the FitToPagesWide and FitToPagesTall properties control how the worksheet is scaled.
setPicture(boolean isFirst, boolean isEven, boolean isHeader, int section, byte[] imageData)Sets an image in the header/footer of a worksheet.
setPrintArea(String value)Represents the range to be printed.
setPrintComments(int value)Represents the way comments are printed with the sheet.
setPrintCopies(int value)Sets number of copies to print.
setPrintDraft(boolean value)Represents if the sheet will be printed without graphics.
setPrintErrors(int value)Specifies the type of print error displayed.
setPrintGridlines(boolean value)Represents if cell gridlines are printed on the page.
setPrintHeadings(boolean value)Represents if row and column headings are printed with this page.
setPrintQuality(int value)Represents the print quality.
setPrintTitleColumns(String value)Represents the columns that contain the cells to be repeated on the left side of each page.
setPrintTitleRows(String value)Represents the rows that contain the cells to be repeated at the top of each page.
setPrinterSettings(byte[] value)Sets the settings of the default printer.
setRightMargin(double value)Represents the size of the right margin, in unit of centimeters.
setRightMarginInch(double value)Represents the size of the right margin, in unit of inches.
setTopMargin(double value)Represents the size of the top margin, in unit of centimeters.
setTopMarginInch(double value)Represents the size of the top margin, in unit of inches.
setZoom(int value)Represents the scaling factor in percent.
toString()
wait()
wait(long arg0)
wait(long arg0, int arg1)

clearHeaderFooter()

public void clearHeaderFooter()

Clears header and footer setting.

copy(PageSetup source, CopyOptions copyOptions)

public void copy(PageSetup source, CopyOptions copyOptions)

Copies the setting of the page setup.

Parameters:

ParameterTypeDescription
sourcePageSetupThe source.
copyOptionsCopyOptionsThe copy options.

customPaperSize(double width, double height)

public void customPaperSize(double width, double height)

Sets the custom paper size, in unit of inches.

Parameters:

ParameterTypeDescription
widthdoubleThe width of the paper.
heightdoubleThe height of the paper.

equals(Object arg0)

public boolean equals(Object arg0)

Parameters:

ParameterTypeDescription
arg0java.lang.Object

Returns: boolean

getBlackAndWhite()

public boolean getBlackAndWhite()

Represents if elements of the document will be printed in black and white.

Returns: boolean

getBottomMargin()

public double getBottomMargin()

Represents the size of the bottom margin, in unit of centimeters.

Returns: double

getBottomMarginInch()

public double getBottomMarginInch()

Represents the size of the bottom margin, in unit of inches.

Returns: double

getCenterHorizontally()

public boolean getCenterHorizontally()

Represent if the sheet is printed centered horizontally.

Returns: boolean

getCenterVertically()

public boolean getCenterVertically()

Represent if the sheet is printed centered vertically.

Returns: boolean

getClass()

public final native Class<?> getClass()

Returns: java.lang.Class

getCommands(String headerFooterScript)

public HeaderFooterCommand[] getCommands(String headerFooterScript)

Gets all commands of header or footer.

Parameters:

ParameterTypeDescription
headerFooterScriptjava.lang.StringThe header/footer script

Returns: com.aspose.cells.HeaderFooterCommand[] - Returns all commands of header or footer.

getEvenFooter(int section)

public String getEvenFooter(int section)

Gets a script formatting the even footer of an Excel file.

Parameters:

ParameterTypeDescription
sectionint0: Left Section, 1: Center Section, 2: Right Section.

Returns: java.lang.String

getEvenHeader(int section)

public String getEvenHeader(int section)

Gets a script formatting the even header of an Excel file.

Parameters:

ParameterTypeDescription
sectionint0: Left Section, 1: Center Section, 2: Right Section.

Returns: java.lang.String

getFirstPageFooter(int section)

public String getFirstPageFooter(int section)

Gets a script formatting the first page footer of an Excel file.

Parameters:

ParameterTypeDescription
sectionint0: Left Section, 1: Center Section, 2: Right Section.

Returns: java.lang.String

getFirstPageHeader(int section)

public String getFirstPageHeader(int section)

Gets a script formatting the first page header of an Excel file.

Parameters:

ParameterTypeDescription
sectionint0: Left Section, 1: Center Section, 2: Right Section.

Returns: java.lang.String

getFirstPageNumber()

public int getFirstPageNumber()

Represents the first page number that will be used when this sheet is printed.

Returns: int

getFitToPagesTall()

public int getFitToPagesTall()

Represents the number of pages tall the worksheet will be scaled to when it’s printed. The default value is 1.

Remarks

You have to set FitToPagesWide as zero if you want to fit all rows on one page.

Returns: int

getFitToPagesWide()

public int getFitToPagesWide()

Represents the number of pages wide the worksheet will be scaled to when it’s printed. The default value is 1.

Remarks

You have to set FitToPagesTall as zero if you want to fit all columns on one page.

Returns: int

getFooter(int section)

public String getFooter(int section)

Gets a script formatting the footer of an Excel file.

Parameters:

ParameterTypeDescription
sectionint0: Left Section, 1: Center Section, 2: Right Section.

Returns: java.lang.String

getFooterMargin()

public double getFooterMargin()

Represents the distance from the bottom of the page to the footer, in unit of centimeters.

Returns: double

getFooterMarginInch()

public double getFooterMarginInch()

Represents the distance from the bottom of the page to the footer, in unit of inches.

Returns: double

getHeader(int section)

public String getHeader(int section)

Gets a script formatting the header of an Excel file.

Parameters:

ParameterTypeDescription
sectionint0: Left Section, 1: Center Section, 2: Right Section.

Returns: java.lang.String

getHeaderMargin()

public double getHeaderMargin()

Represents the distance from the top of the page to the header, in unit of centimeters.

Returns: double

getHeaderMarginInch()

public double getHeaderMarginInch()

Represents the distance from the top of the page to the header, in unit of inches.

Returns: double

getLeftMargin()

public double getLeftMargin()

Represents the size of the left margin, in unit of centimeters.

Returns: double

getLeftMarginInch()

public double getLeftMarginInch()

Represents the size of the left margin, in unit of inches.

Returns: double

getODSPageBackground()

public OdsPageBackground getODSPageBackground()

Gets the background of ODS.

Returns: OdsPageBackground

getOrder()

public int getOrder()

Represents the order that Microsoft Excel uses to number pages when printing a large worksheet.

See PrintOrderType.

Returns: int

getOrientation()

public int getOrientation()

Represents page print orientation.

See PageOrientationType.

Returns: int

getPaperHeight()

public double getPaperHeight()

Gets the height of the paper in unit of inches , considered page orientation.

Returns: double

getPaperSize()

public int getPaperSize()

Represents the size of the paper.

See PaperSizeType.

Returns: int

getPaperWidth()

public double getPaperWidth()

Gets the width of the paper in unit of inches, considered page orientation.

Returns: double

getPicture(boolean isFirst, boolean isEven, boolean isHeader, int section)

public Picture getPicture(boolean isFirst, boolean isEven, boolean isHeader, int section)

Gets the Picture object of the header / footer.

Parameters:

ParameterTypeDescription
isFirstbooleanIndicates whether getting the picture of first page header/footer.
isEvenbooleanIndicates whether getting the picture of even page header/footer.
isHeaderbooleanIndicates whether getting the picture of header/footer.
sectionint0: Left Section, 1: Center Section, 2: Right Section.

Returns: Picture - Returns Picture object.

getPicture(boolean isHeader, int section)

public Picture getPicture(boolean isHeader, int section)

Gets the Picture object of the header / footer.

Parameters:

ParameterTypeDescription
isHeaderbooleanIndicates whether it is in the header or footer.
sectionint0: Left Section, 1: Center Section, 2: Right Section.

Returns: Picture - Returns Picture object. Returns null if there is no picture.

getPrintArea()

public String getPrintArea()

Represents the range to be printed.

Returns: java.lang.String

getPrintComments()

public int getPrintComments()

Represents the way comments are printed with the sheet.

See PrintCommentsType.

Returns: int

getPrintCopies()

public int getPrintCopies()

Gets number of copies to print.

Returns: int

getPrintDraft()

public boolean getPrintDraft()

Represents if the sheet will be printed without graphics.

Returns: boolean

getPrintErrors()

public int getPrintErrors()

Specifies the type of print error displayed.

See PrintErrorsType.

Returns: int

getPrintGridlines()

public boolean getPrintGridlines()

Represents if cell gridlines are printed on the page.

Returns: boolean

getPrintHeadings()

public boolean getPrintHeadings()

Represents if row and column headings are printed with this page.

Returns: boolean

getPrintQuality()

public int getPrintQuality()

Represents the print quality.

Returns: int

getPrintTitleColumns()

public String getPrintTitleColumns()

Represents the columns that contain the cells to be repeated on the left side of each page.

Example

         pageSetup.setPrintTitleColumns("$A:$A");

Returns: java.lang.String

getPrintTitleRows()

public String getPrintTitleRows()

Represents the rows that contain the cells to be repeated at the top of each page.

Example

         pageSetup.setPrintTitleRows("$1:$1");

Returns: java.lang.String

getPrinterSettings()

public byte[] getPrinterSettings()

Gets the settings of the default printer.

Returns: byte[]

getRightMargin()

public double getRightMargin()

Represents the size of the right margin, in unit of centimeters.

Returns: double

getRightMarginInch()

public double getRightMarginInch()

Represents the size of the right margin, in unit of inches.

Returns: double

getTopMargin()

public double getTopMargin()

Represents the size of the top margin, in unit of centimeters.

Returns: double

getTopMarginInch()

public double getTopMarginInch()

Represents the size of the top margin, in unit of inches.

Returns: double

getZoom()

public int getZoom()

Represents the scaling factor in percent. It should be between 10 and 400.

Returns: int

hashCode()

public native int hashCode()

Returns: int

isAutoFirstPageNumber()

public boolean isAutoFirstPageNumber()

Indicates whether the first the page number is automatically assigned.

Returns: boolean

isAutomaticPaperSize()

public boolean isAutomaticPaperSize()

Indicates whether the paper size is automatic.

Returns: boolean

isHFAlignMargins()

public boolean isHFAlignMargins()

Indicates whether header and footer margins are aligned with the page margins. If this property is true, the left header and footer will be aligned with the left margin, and the right header and footer will be aligned with the right margin. This option is enabled by default.

Returns: boolean

isHFDiffFirst()

public boolean isHFDiffFirst()

True means that the header/footer of the first page is different with other pages.

Returns: boolean

isHFDiffOddEven()

public boolean isHFDiffOddEven()

True means that the header/footer of the odd pages is different with odd pages.

Returns: boolean

isHFScaleWithDoc()

public boolean isHFScaleWithDoc()

Indicates whether header and footer are scaled with document scaling. Only applies for Excel 2007.

Returns: boolean

isPercentScale()

public boolean isPercentScale()

If this property is False, the FitToPagesWide and FitToPagesTall properties control how the worksheet is scaled.

Returns: boolean

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

setAutoFirstPageNumber(boolean value)

public void setAutoFirstPageNumber(boolean value)

Indicates whether the first the page number is automatically assigned.

Parameters:

ParameterTypeDescription
valueboolean

setBlackAndWhite(boolean value)

public void setBlackAndWhite(boolean value)

Represents if elements of the document will be printed in black and white.

Parameters:

ParameterTypeDescription
valueboolean

setBottomMargin(double value)

public void setBottomMargin(double value)

Represents the size of the bottom margin, in unit of centimeters.

Parameters:

ParameterTypeDescription
valuedouble

setBottomMarginInch(double value)

public void setBottomMarginInch(double value)

Represents the size of the bottom margin, in unit of inches.

Parameters:

ParameterTypeDescription
valuedouble

setCenterHorizontally(boolean value)

public void setCenterHorizontally(boolean value)

Represent if the sheet is printed centered horizontally.

Parameters:

ParameterTypeDescription
valueboolean

setCenterVertically(boolean value)

public void setCenterVertically(boolean value)

Represent if the sheet is printed centered vertically.

Parameters:

ParameterTypeDescription
valueboolean

setEvenFooter(int section, String footerScript)

public void setEvenFooter(int section, String footerScript)

Sets a script formatting the even page footer of an Excel file. Only effect in Excel 2007 when IsHFDiffOddEven is true.

Parameters:

ParameterTypeDescription
sectionint0: Left Section, 1: Center Section, 2: Right Section.
footerScriptjava.lang.StringFooter format script.

setEvenHeader(int section, String headerScript)

public void setEvenHeader(int section, String headerScript)

Sets a script formatting the even page header of an Excel file. Only effect in Excel 2007 when IsHFDiffOddEven is true.

Parameters:

ParameterTypeDescription
sectionint0: Left Section, 1: Center Section, 2: Right Section.
headerScriptjava.lang.StringHeader format script.

setFirstPageFooter(int section, String footerScript)

public void setFirstPageFooter(int section, String footerScript)

Sets a script formatting the first page footer of an Excel file.

Parameters:

ParameterTypeDescription
sectionint0: Left Section, 1: Center Section, 2: Right Section.
footerScriptjava.lang.StringFooter format script.

setFirstPageHeader(int section, String headerScript)

public void setFirstPageHeader(int section, String headerScript)

Sets a script formatting the first page header of an Excel file. Only effect in Excel 2007 when IsHFDiffFirst is true.

Parameters:

ParameterTypeDescription
sectionint0: Left Section, 1: Center Section, 2: Right Section.
headerScriptjava.lang.StringHeader format script.

setFirstPageNumber(int value)

public void setFirstPageNumber(int value)

Represents the first page number that will be used when this sheet is printed.

Parameters:

ParameterTypeDescription
valueint

setFitToPages(int wide, int tall)

public void setFitToPages(int wide, int tall)

Sets the number of pages the worksheet will be scaled to when it’s printed.

Parameters:

ParameterTypeDescription
wideintPages wide.
tallintPages tall.

setFitToPagesTall(int value)

public void setFitToPagesTall(int value)

Represents the number of pages tall the worksheet will be scaled to when it’s printed. The default value is 1.

Remarks

You have to set FitToPagesWide as zero if you want to fit all rows on one page.

Parameters:

ParameterTypeDescription
valueint

setFitToPagesWide(int value)

public void setFitToPagesWide(int value)

Represents the number of pages wide the worksheet will be scaled to when it’s printed. The default value is 1.

Remarks

You have to set FitToPagesTall as zero if you want to fit all columns on one page.

Parameters:

ParameterTypeDescription
valueint

setFooter(int section, String footerScript)

public void setFooter(int section, String footerScript)

Sets a script formatting the footer of an Excel file.

Remarks

Script commands:

CommandDescription
&PCurrent page number\u9286\u20ac
&NPage count\u9286\u20ac
&DCurrent date\u9286\u20ac
&TCurrent time
&ASheet name
&FFile name without path
&""Font name, for example: &“Arial”
&", "Font name and font style, for example: &“Arial,Bold”
&Font size. If this command is followed by a plain number to be printed in the header, it will be separated from the font height with a space character.
&KFont color, for example(RED): &KFF0000
&GImage script

For example: “&Arial,Bold&8Footer Note”

Parameters:

ParameterTypeDescription
sectionint0: Left Section, 1: Center Section, 2: Right Section.
footerScriptjava.lang.StringFooter format script.

setFooterMargin(double value)

public void setFooterMargin(double value)

Represents the distance from the bottom of the page to the footer, in unit of centimeters.

Parameters:

ParameterTypeDescription
valuedouble

setFooterMarginInch(double value)

public void setFooterMarginInch(double value)

Represents the distance from the bottom of the page to the footer, in unit of inches.

Parameters:

ParameterTypeDescription
valuedouble

setFooterPicture(int section, byte[] footerPicture)

public Picture setFooterPicture(int section, byte[] footerPicture)

Sets an image in the footer of a worksheet.

Parameters:

ParameterTypeDescription
sectionint0: Left Section, 1: Center Section, 2: Right Section.
footerPicturebyte[]Image data.

Returns: Picture - Returns Picture object.

setHFAlignMargins(boolean value)

public void setHFAlignMargins(boolean value)

Indicates whether header and footer margins are aligned with the page margins. If this property is true, the left header and footer will be aligned with the left margin, and the right header and footer will be aligned with the right margin. This option is enabled by default.

Parameters:

ParameterTypeDescription
valueboolean

setHFDiffFirst(boolean value)

public void setHFDiffFirst(boolean value)

True means that the header/footer of the first page is different with other pages.

Parameters:

ParameterTypeDescription
valueboolean

setHFDiffOddEven(boolean value)

public void setHFDiffOddEven(boolean value)

True means that the header/footer of the odd pages is different with odd pages.

Parameters:

ParameterTypeDescription
valueboolean

setHFScaleWithDoc(boolean value)

public void setHFScaleWithDoc(boolean value)

Indicates whether header and footer are scaled with document scaling. Only applies for Excel 2007.

Parameters:

ParameterTypeDescription
valueboolean

setHeader(int section, String headerScript)

public void setHeader(int section, String headerScript)

Sets a script formatting the header of an Excel file.

Remarks

Script commands:

CommandDescription
&PCurrent page number\u9286\u20ac
&NPage count\u9286\u20ac
&DCurrent date\u9286\u20ac
&TCurrent time
&ASheet name
&FFile name without path
&""Font name, for example: &“Arial”
&", "Font name and font style, for example: &“Arial,Bold”
&Font size. If this command is followed by a plain number to be printed in the header, it will be separated from the font height with a space character.
&KFont color, for example(RED): &KFF0000
&GImage script

For example: “&Arial,Bold&8Header Note”

Parameters:

ParameterTypeDescription
sectionint0: Left Section, 1: Center Section, 2: Right Section.
headerScriptjava.lang.StringHeader format script.

setHeaderMargin(double value)

public void setHeaderMargin(double value)

Represents the distance from the top of the page to the header, in unit of centimeters.

Parameters:

ParameterTypeDescription
valuedouble

setHeaderMarginInch(double value)

public void setHeaderMarginInch(double value)

Represents the distance from the top of the page to the header, in unit of inches.

Parameters:

ParameterTypeDescription
valuedouble

setHeaderPicture(int section, byte[] headerPicture)

public Picture setHeaderPicture(int section, byte[] headerPicture)

Sets an image in the header of a worksheet.

Parameters:

ParameterTypeDescription
sectionint0: Left Section, 1: Center Section, 2: Right Section.
headerPicturebyte[]Image data.

Returns: Picture - Returns Picture object.

setLeftMargin(double value)

public void setLeftMargin(double value)

Represents the size of the left margin, in unit of centimeters.

Parameters:

ParameterTypeDescription
valuedouble

setLeftMarginInch(double value)

public void setLeftMarginInch(double value)

Represents the size of the left margin, in unit of inches.

Parameters:

ParameterTypeDescription
valuedouble

setOrder(int value)

public void setOrder(int value)

Represents the order that Microsoft Excel uses to number pages when printing a large worksheet.

See PrintOrderType.

Parameters:

ParameterTypeDescription
valueint

setOrientation(int value)

public void setOrientation(int value)

Represents page print orientation.

See PageOrientationType.

Parameters:

ParameterTypeDescription
valueint

setPaperSize(int value)

public void setPaperSize(int value)

Represents the size of the paper.

See PaperSizeType.

Parameters:

ParameterTypeDescription
valueint

setPercentScale(boolean value)

public void setPercentScale(boolean value)

If this property is False, the FitToPagesWide and FitToPagesTall properties control how the worksheet is scaled.

Parameters:

ParameterTypeDescription
valueboolean

setPicture(boolean isFirst, boolean isEven, boolean isHeader, int section, byte[] imageData)

public Picture setPicture(boolean isFirst, boolean isEven, boolean isHeader, int section, byte[] imageData)

Sets an image in the header/footer of a worksheet.

Parameters:

ParameterTypeDescription
isFirstbooleanIndicates whether setting the picture of first page header/footer.
isEvenbooleanIndicates whether setting the picture of even page header/footer.
isHeaderbooleanIndicates whether setting the picture of header/footer.
sectionint0: Left Section, 1: Center Section, 2: Right Section.
imageDatabyte[]Image data.

Returns: Picture - Returns Picture object.

setPrintArea(String value)

public void setPrintArea(String value)

Represents the range to be printed.

Parameters:

ParameterTypeDescription
valuejava.lang.String

setPrintComments(int value)

public void setPrintComments(int value)

Represents the way comments are printed with the sheet.

See PrintCommentsType.

Parameters:

ParameterTypeDescription
valueint

setPrintCopies(int value)

public void setPrintCopies(int value)

Sets number of copies to print.

Parameters:

ParameterTypeDescription
valueint

setPrintDraft(boolean value)

public void setPrintDraft(boolean value)

Represents if the sheet will be printed without graphics.

Parameters:

ParameterTypeDescription
valueboolean

setPrintErrors(int value)

public void setPrintErrors(int value)

Specifies the type of print error displayed.

See PrintErrorsType.

Parameters:

ParameterTypeDescription
valueint

setPrintGridlines(boolean value)

public void setPrintGridlines(boolean value)

Represents if cell gridlines are printed on the page.

Parameters:

ParameterTypeDescription
valueboolean

setPrintHeadings(boolean value)

public void setPrintHeadings(boolean value)

Represents if row and column headings are printed with this page.

Parameters:

ParameterTypeDescription
valueboolean

setPrintQuality(int value)

public void setPrintQuality(int value)

Represents the print quality.

Parameters:

ParameterTypeDescription
valueint

setPrintTitleColumns(String value)

public void setPrintTitleColumns(String value)

Represents the columns that contain the cells to be repeated on the left side of each page.

Parameters:

ParameterTypeDescription
valuejava.lang.String

setPrintTitleRows(String value)

public void setPrintTitleRows(String value)

Represents the rows that contain the cells to be repeated at the top of each page.

Parameters:

ParameterTypeDescription
valuejava.lang.String

setPrinterSettings(byte[] value)

public void setPrinterSettings(byte[] value)

Sets the settings of the default printer.

Parameters:

ParameterTypeDescription
valuebyte[]

setRightMargin(double value)

public void setRightMargin(double value)

Represents the size of the right margin, in unit of centimeters.

Parameters:

ParameterTypeDescription
valuedouble

setRightMarginInch(double value)

public void setRightMarginInch(double value)

Represents the size of the right margin, in unit of inches.

Parameters:

ParameterTypeDescription
valuedouble

setTopMargin(double value)

public void setTopMargin(double value)

Represents the size of the top margin, in unit of centimeters.

Parameters:

ParameterTypeDescription
valuedouble

setTopMarginInch(double value)

public void setTopMarginInch(double value)

Represents the size of the top margin, in unit of inches.

Parameters:

ParameterTypeDescription
valuedouble

setZoom(int value)

public void setZoom(int value)

Represents the scaling factor in percent. It should be between 10 and 400.

Parameters:

ParameterTypeDescription
valueint

toString()

public String toString()

Returns: java.lang.String

wait()

public final void wait()

wait(long arg0)

public final native void wait(long arg0)

Parameters:

ParameterTypeDescription
arg0long

wait(long arg0, int arg1)

public final void wait(long arg0, int arg1)

Parameters:

ParameterTypeDescription
arg0long
arg1int