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
Method | Description |
---|---|
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:
Parameter | Type | Description |
---|---|---|
source | PageSetup | The source. |
copyOptions | CopyOptions | The copy options. |
customPaperSize(double width, double height)
public void customPaperSize(double width, double height)
Sets the custom paper size, in unit of inches.
Parameters:
Parameter | Type | Description |
---|---|---|
width | double | The width of the paper. |
height | double | The height of the paper. |
equals(Object arg0)
public boolean equals(Object arg0)
Parameters:
Parameter | Type | Description |
---|---|---|
arg0 | java.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:
Parameter | Type | Description |
---|---|---|
headerFooterScript | java.lang.String | The 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:
Parameter | Type | Description |
---|---|---|
section | int | 0: 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:
Parameter | Type | Description |
---|---|---|
section | int | 0: 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:
Parameter | Type | Description |
---|---|---|
section | int | 0: 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:
Parameter | Type | Description |
---|---|---|
section | int | 0: 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:
Parameter | Type | Description |
---|---|---|
section | int | 0: 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:
Parameter | Type | Description |
---|---|---|
section | int | 0: 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:
Parameter | Type | Description |
---|---|---|
isFirst | boolean | Indicates whether getting the picture of first page header/footer. |
isEven | boolean | Indicates whether getting the picture of even page header/footer. |
isHeader | boolean | Indicates whether getting the picture of header/footer. |
section | int | 0: 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:
Parameter | Type | Description |
---|---|---|
isHeader | boolean | Indicates whether it is in the header or footer. |
section | int | 0: 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:
Parameter | Type | Description |
---|---|---|
value | boolean |
setBlackAndWhite(boolean value)
public void setBlackAndWhite(boolean value)
Represents if elements of the document will be printed in black and white.
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean |
setBottomMargin(double value)
public void setBottomMargin(double value)
Represents the size of the bottom margin, in unit of centimeters.
Parameters:
Parameter | Type | Description |
---|---|---|
value | double |
setBottomMarginInch(double value)
public void setBottomMarginInch(double value)
Represents the size of the bottom margin, in unit of inches.
Parameters:
Parameter | Type | Description |
---|---|---|
value | double |
setCenterHorizontally(boolean value)
public void setCenterHorizontally(boolean value)
Represent if the sheet is printed centered horizontally.
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean |
setCenterVertically(boolean value)
public void setCenterVertically(boolean value)
Represent if the sheet is printed centered vertically.
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean |
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:
Parameter | Type | Description |
---|---|---|
section | int | 0: Left Section, 1: Center Section, 2: Right Section. |
footerScript | java.lang.String | Footer 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:
Parameter | Type | Description |
---|---|---|
section | int | 0: Left Section, 1: Center Section, 2: Right Section. |
headerScript | java.lang.String | Header 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:
Parameter | Type | Description |
---|---|---|
section | int | 0: Left Section, 1: Center Section, 2: Right Section. |
footerScript | java.lang.String | Footer 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:
Parameter | Type | Description |
---|---|---|
section | int | 0: Left Section, 1: Center Section, 2: Right Section. |
headerScript | java.lang.String | Header 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:
Parameter | Type | Description |
---|---|---|
value | int |
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:
Parameter | Type | Description |
---|---|---|
wide | int | Pages wide. |
tall | int | Pages 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:
Parameter | Type | Description |
---|---|---|
value | int |
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:
Parameter | Type | Description |
---|---|---|
value | int |
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:
Command | Description |
---|---|
&P | Current page number\u9286\u20ac |
&N | Page count\u9286\u20ac |
&D | Current date\u9286\u20ac |
&T | Current time |
&A | Sheet name |
&F | File 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. |
&K | Font color, for example(RED): &KFF0000 |
&G | Image script |
For example: “&Arial,Bold&8Footer Note”
Parameters:
Parameter | Type | Description |
---|---|---|
section | int | 0: Left Section, 1: Center Section, 2: Right Section. |
footerScript | java.lang.String | Footer 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:
Parameter | Type | Description |
---|---|---|
value | double |
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:
Parameter | Type | Description |
---|---|---|
value | double |
setFooterPicture(int section, byte[] footerPicture)
public Picture setFooterPicture(int section, byte[] footerPicture)
Sets an image in the footer of a worksheet.
Parameters:
Parameter | Type | Description |
---|---|---|
section | int | 0: Left Section, 1: Center Section, 2: Right Section. |
footerPicture | byte[] | 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:
Parameter | Type | Description |
---|---|---|
value | boolean |
setHFDiffFirst(boolean value)
public void setHFDiffFirst(boolean value)
True means that the header/footer of the first page is different with other pages.
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean |
setHFDiffOddEven(boolean value)
public void setHFDiffOddEven(boolean value)
True means that the header/footer of the odd pages is different with odd pages.
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean |
setHFScaleWithDoc(boolean value)
public void setHFScaleWithDoc(boolean value)
Indicates whether header and footer are scaled with document scaling. Only applies for Excel 2007.
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean |
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:
Command | Description |
---|---|
&P | Current page number\u9286\u20ac |
&N | Page count\u9286\u20ac |
&D | Current date\u9286\u20ac |
&T | Current time |
&A | Sheet name |
&F | File 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. |
&K | Font color, for example(RED): &KFF0000 |
&G | Image script |
For example: “&Arial,Bold&8Header Note”
Parameters:
Parameter | Type | Description |
---|---|---|
section | int | 0: Left Section, 1: Center Section, 2: Right Section. |
headerScript | java.lang.String | Header 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:
Parameter | Type | Description |
---|---|---|
value | double |
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:
Parameter | Type | Description |
---|---|---|
value | double |
setHeaderPicture(int section, byte[] headerPicture)
public Picture setHeaderPicture(int section, byte[] headerPicture)
Sets an image in the header of a worksheet.
Parameters:
Parameter | Type | Description |
---|---|---|
section | int | 0: Left Section, 1: Center Section, 2: Right Section. |
headerPicture | byte[] | 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:
Parameter | Type | Description |
---|---|---|
value | double |
setLeftMarginInch(double value)
public void setLeftMarginInch(double value)
Represents the size of the left margin, in unit of inches.
Parameters:
Parameter | Type | Description |
---|---|---|
value | double |
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:
Parameter | Type | Description |
---|---|---|
value | int |
setOrientation(int value)
public void setOrientation(int value)
Represents page print orientation.
See PageOrientationType.
Parameters:
Parameter | Type | Description |
---|---|---|
value | int |
setPaperSize(int value)
public void setPaperSize(int value)
Represents the size of the paper.
See PaperSizeType.
Parameters:
Parameter | Type | Description |
---|---|---|
value | int |
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:
Parameter | Type | Description |
---|---|---|
value | boolean |
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:
Parameter | Type | Description |
---|---|---|
isFirst | boolean | Indicates whether setting the picture of first page header/footer. |
isEven | boolean | Indicates whether setting the picture of even page header/footer. |
isHeader | boolean | Indicates whether setting the picture of header/footer. |
section | int | 0: Left Section, 1: Center Section, 2: Right Section. |
imageData | byte[] | Image data. |
Returns: Picture - Returns Picture object.
setPrintArea(String value)
public void setPrintArea(String value)
Represents the range to be printed.
Parameters:
Parameter | Type | Description |
---|---|---|
value | java.lang.String |
setPrintComments(int value)
public void setPrintComments(int value)
Represents the way comments are printed with the sheet.
See PrintCommentsType.
Parameters:
Parameter | Type | Description |
---|---|---|
value | int |
setPrintCopies(int value)
public void setPrintCopies(int value)
Sets number of copies to print.
Parameters:
Parameter | Type | Description |
---|---|---|
value | int |
setPrintDraft(boolean value)
public void setPrintDraft(boolean value)
Represents if the sheet will be printed without graphics.
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean |
setPrintErrors(int value)
public void setPrintErrors(int value)
Specifies the type of print error displayed.
See PrintErrorsType.
Parameters:
Parameter | Type | Description |
---|---|---|
value | int |
setPrintGridlines(boolean value)
public void setPrintGridlines(boolean value)
Represents if cell gridlines are printed on the page.
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean |
setPrintHeadings(boolean value)
public void setPrintHeadings(boolean value)
Represents if row and column headings are printed with this page.
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean |
setPrintQuality(int value)
public void setPrintQuality(int value)
Represents the print quality.
Parameters:
Parameter | Type | Description |
---|---|---|
value | int |
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:
Parameter | Type | Description |
---|---|---|
value | java.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:
Parameter | Type | Description |
---|---|---|
value | java.lang.String |
setPrinterSettings(byte[] value)
public void setPrinterSettings(byte[] value)
Sets the settings of the default printer.
Parameters:
Parameter | Type | Description |
---|---|---|
value | byte[] |
setRightMargin(double value)
public void setRightMargin(double value)
Represents the size of the right margin, in unit of centimeters.
Parameters:
Parameter | Type | Description |
---|---|---|
value | double |
setRightMarginInch(double value)
public void setRightMarginInch(double value)
Represents the size of the right margin, in unit of inches.
Parameters:
Parameter | Type | Description |
---|---|---|
value | double |
setTopMargin(double value)
public void setTopMargin(double value)
Represents the size of the top margin, in unit of centimeters.
Parameters:
Parameter | Type | Description |
---|---|---|
value | double |
setTopMarginInch(double value)
public void setTopMarginInch(double value)
Represents the size of the top margin, in unit of inches.
Parameters:
Parameter | Type | Description |
---|---|---|
value | double |
setZoom(int value)
public void setZoom(int value)
Represents the scaling factor in percent. It should be between 10 and 400.
Parameters:
Parameter | Type | Description |
---|---|---|
value | int |
toString()
public String toString()
Returns: java.lang.String
wait()
public final void wait()
wait(long arg0)
public final native void wait(long arg0)
Parameters:
Parameter | Type | Description |
---|---|---|
arg0 | long |
wait(long arg0, int arg1)
public final void wait(long arg0, int arg1)
Parameters:
Parameter | Type | Description |
---|---|---|
arg0 | long | |
arg1 | int |