|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.poi.POIXMLDocumentPart
org.apache.poi.xssf.usermodel.XSSFSheet
public class XSSFSheet
High level representation of a SpreadsheetML worksheet.
Sheets are the central structures within a workbook, and are where a user does most of his spreadsheet work. The most common type of sheet is the worksheet, which is represented as a grid of cells. Worksheet cells can contain text, numbers, dates, and formulas. Cells can also be formatted.
Field Summary |
---|
Fields inherited from class org.apache.poi.POIXMLDocumentPart |
---|
DEFAULT_XML_OPTIONS |
Fields inherited from interface org.apache.poi.ss.usermodel.Sheet |
---|
BottomMargin, FooterMargin, HeaderMargin, LeftMargin, PANE_LOWER_LEFT, PANE_LOWER_RIGHT, PANE_UPPER_LEFT, PANE_UPPER_RIGHT, RightMargin, TopMargin |
Method Summary | |
---|---|
int |
addMergedRegion(org.apache.poi.ss.util.CellRangeAddress region)
Adds a merged region of cells (hence those cells form one). |
void |
addValidationData(org.apache.poi.ss.usermodel.DataValidation dataValidation)
|
void |
autoSizeColumn(int column)
Adjusts the column width to fit the contents. |
void |
autoSizeColumn(int column,
boolean useMergedCells)
Adjusts the column width to fit the contents. |
org.apache.poi.ss.usermodel.Comment |
createComment()
Creates a new comment for this sheet. |
org.apache.poi.ss.usermodel.Drawing |
createDrawingPatriarch()
Create a new SpreadsheetML drawing. |
void |
createFreezePane(int colSplit,
int rowSplit)
Creates a split (freezepane). |
void |
createFreezePane(int colSplit,
int rowSplit,
int leftmostColumn,
int topRow)
Creates a split (freezepane). |
org.apache.poi.ss.usermodel.Row |
createRow(int rownum)
Create a new row within the sheet and return the high level representation |
void |
createSplitPane(int xSplitPos,
int ySplitPos,
int leftmostColumn,
int topRow,
int activePane)
Creates a split pane. |
void |
disableLocking()
Disable sheet protection |
void |
enableLocking()
Enable sheet protection |
int |
findEndOfRowOutlineGroup(int row)
|
java.lang.String |
getActiveCell()
Return location of the active cell, e.g. |
boolean |
getAutobreaks()
Flag indicating whether the sheet displays Automatic Page Breaks. |
org.apache.poi.ss.usermodel.Comment |
getCellComment(int row,
int column)
|
int[] |
getColumnBreaks()
Vertical page break information used for print layout view, page layout view, drawing print breaks in normal view, and for printing the worksheet. |
ColumnHelper |
getColumnHelper()
|
org.apache.poi.ss.usermodel.CellStyle |
getColumnStyle(int column)
Returns the CellStyle that applies to the given (0 based) column, or null if no style has been set for that column |
int |
getColumnWidth(int columnIndex)
Get the actual column width (in units of 1/256th of a character width ) |
org.openxmlformats.schemas.spreadsheetml.x2006.main.CTWorksheet |
getCTWorksheet()
Provide access to the CTWorksheet bean holding this sheet's data |
org.apache.poi.ss.usermodel.DataValidationHelper |
getDataValidationHelper()
|
java.util.List |
getDataValidations()
|
int |
getDefaultColumnWidth()
Get the default column width for the sheet (if the columns do not define their own width) in characters. |
short |
getDefaultRowHeight()
Get the default row height for the sheet (if the rows do not define their own height) in twips (1/20 of a point) |
float |
getDefaultRowHeightInPoints()
Get the default row height for the sheet measued in point size (if the rows do not define their own height). |
boolean |
getDisplayGuts()
Get whether to display the guts or not, default value is true |
org.apache.poi.ss.usermodel.Footer |
getEvenFooter()
Returns the even footer. |
org.apache.poi.ss.usermodel.Header |
getEvenHeader()
Returns the even header. |
org.apache.poi.ss.usermodel.Footer |
getFirstFooter()
Returns the first page footer. |
org.apache.poi.ss.usermodel.Header |
getFirstHeader()
Returns the first page header. |
int |
getFirstRowNum()
Gets the first row on the sheet |
boolean |
getFitToPage()
Flag indicating whether the Fit to Page print option is enabled. |
org.apache.poi.ss.usermodel.Footer |
getFooter()
Returns the default footer for the sheet, creating one as needed. |
org.apache.poi.ss.usermodel.Header |
getHeader()
Returns the default header for the sheet, creating one as needed. |
boolean |
getHorizontallyCenter()
Determine whether printed output for this sheet will be horizontally centered. |
org.apache.poi.ss.usermodel.Hyperlink |
getHyperlink(int row,
int column)
|
int |
getLastRowNum()
|
short |
getLeftCol()
|
double |
getMargin(short margin)
Gets the size of the margin in inches. |
org.apache.poi.ss.util.CellRangeAddress |
getMergedRegion(int index)
|
int |
getNumHyperlinks()
|
int |
getNumMergedRegions()
Returns the number of merged regions defined in this worksheet |
org.apache.poi.ss.usermodel.Footer |
getOddFooter()
Returns the odd footer. |
org.apache.poi.ss.usermodel.Header |
getOddHeader()
Returns the odd header. |
org.apache.poi.hssf.util.PaneInformation |
getPaneInformation()
Returns the information regarding the currently configured pane (split or freeze). |
int |
getPhysicalNumberOfRows()
Returns the number of phsyically defined rows (NOT the number of rows in the sheet) |
org.apache.poi.ss.usermodel.PrintSetup |
getPrintSetup()
Gets the print setup object. |
boolean |
getProtect()
Answer whether protection is enabled or disabled |
org.apache.poi.ss.usermodel.Row |
getRow(int rownum)
Returns the logical row ( 0-based). |
int[] |
getRowBreaks()
Horizontal page break information used for print layout view, page layout view, drawing print breaks in normal view, and for printing the worksheet. |
boolean |
getRowSumsBelow()
Flag indicating whether summary rows appear below detail in an outline, when applying an outline. |
boolean |
getRowSumsRight()
Flag indicating whether summary columns appear to the right of detail in an outline, when applying an outline. |
boolean |
getScenarioProtect()
A flag indicating whether scenarios are locked when the sheet is protected. |
java.lang.String |
getSheetName()
Returns the name of this sheet |
short |
getTopRow()
The top row in the visible view when the sheet is first viewed after opening it in a viewer |
boolean |
getVerticallyCenter()
Determine whether printed output for this sheet will be vertically centered. |
org.apache.poi.ss.usermodel.Workbook |
getWorkbook()
Returns the parent XSSFWorkbook |
void |
groupColumn(int fromColumn,
int toColumn)
Group between (0 based) columns |
void |
groupRow(int fromRow,
int toRow)
Tie a range of cell together so that they can be collapsed or expanded |
boolean |
hasComments()
Does this sheet have any comments on it? We need to know, so we can decide about writing it to disk or not |
boolean |
isAutoFilterLocked()
|
boolean |
isColumnBroken(int column)
Determines if there is a page break at the indicated column |
boolean |
isColumnHidden(int columnIndex)
Get the hidden state for a given column. |
boolean |
isDeleteColumnsLocked()
|
boolean |
isDeleteRowsLocked()
|
boolean |
isDisplayFormulas()
Gets the flag indicating whether this sheet should display formulas. |
boolean |
isDisplayGridlines()
Gets the flag indicating whether this sheet displays the lines between rows and columns to make editing and reading easier. |
boolean |
isDisplayRowColHeadings()
Gets the flag indicating whether this sheet should display row and column headings. |
boolean |
isDisplayZeros()
Gets the flag indicating whether the window should show 0 (zero) in cells containing zero value. |
boolean |
isFormatCellsLocked()
|
boolean |
isFormatColumnsLocked()
|
boolean |
isFormatRowsLocked()
|
boolean |
isInsertColumnsLocked()
|
boolean |
isInsertHyperlinksLocked()
|
boolean |
isInsertRowsLocked()
|
boolean |
isObjectsLocked()
|
boolean |
isPivotTablesLocked()
|
boolean |
isPrintGridlines()
Returns whether gridlines are printed. |
boolean |
isRowBroken(int row)
Tests if there is a page break at the indicated row |
boolean |
isScenariosLocked()
|
boolean |
isSelected()
Returns a flag indicating whether this sheet is selected. |
boolean |
isSelectLockedCellsLocked()
|
boolean |
isSelectUnlockedCellsLocked()
|
boolean |
isSheetLocked()
|
boolean |
isSortLocked()
|
java.util.Iterator |
iterator()
Alias for rowIterator() to
allow foreach loops |
void |
lockAutoFilter()
Enable Autofilters locking. |
void |
lockDeleteColumns()
Enable Deleting columns locking. |
void |
lockDeleteRows()
Enable Deleting rows locking. |
void |
lockFormatCells()
Enable Formatting cells locking. |
void |
lockFormatColumns()
Enable Formatting columns locking. |
void |
lockFormatRows()
Enable Formatting rows locking. |
void |
lockInsertColumns()
Enable Inserting columns locking. |
void |
lockInsertHyperlinks()
Enable Inserting hyperlinks locking. |
void |
lockInsertRows()
Enable Inserting rows locking. |
void |
lockObjects()
Enable Objects locking. |
void |
lockPivotTables()
Enable Pivot Tables locking. |
void |
lockScenarios()
Enable Scenarios locking. |
void |
lockSelectLockedCells()
Enable Selection of locked cells locking. |
void |
lockSelectUnlockedCells()
Enable Selection of unlocked cells locking. |
void |
lockSort()
Enable Sort locking. |
void |
protectSheet(java.lang.String password)
Enables sheet protection and sets the password for the sheet. |
org.apache.poi.ss.usermodel.CellRange |
removeArrayFormula(org.apache.poi.ss.usermodel.Cell cell)
|
void |
removeColumnBreak(int column)
Removes a page break at the indicated column |
void |
removeMergedRegion(int index)
Removes a merged region of cells (hence letting them free) |
void |
removeRow(org.apache.poi.ss.usermodel.Row row)
Remove a row from this sheet. |
void |
removeRowBreak(int row)
Removes the page break at the indicated row |
java.util.Iterator |
rowIterator()
|
void |
setActiveCell(java.lang.String cellRef)
Sets location of the active cell |
org.apache.poi.ss.usermodel.CellRange |
setArrayFormula(java.lang.String formula,
org.apache.poi.ss.util.CellRangeAddress range)
|
void |
setAutobreaks(boolean value)
Flag indicating whether the sheet displays Automatic Page Breaks. |
org.apache.poi.ss.usermodel.AutoFilter |
setAutoFilter(org.apache.poi.ss.util.CellRangeAddress range)
|
static void |
setCellComment(java.lang.String cellRef,
XSSFComment comment)
Assign a cell comment to a cell region in this worksheet |
void |
setColumnBreak(int column)
Sets a page break at the indicated column |
void |
setColumnGroupCollapsed(int columnNumber,
boolean collapsed)
|
void |
setColumnHidden(int columnIndex,
boolean hidden)
Get the visibility state for a given column. |
void |
setColumnWidth(int columnIndex,
int width)
Set the width (in units of 1/256th of a character width) |
void |
setDefaultColumnStyle(int column,
org.apache.poi.ss.usermodel.CellStyle style)
|
void |
setDefaultColumnWidth(int width)
Specifies the number of characters of the maximum digit width of the normal style's font. |
void |
setDefaultRowHeight(short height)
Set the default row height for the sheet (if the rows do not define their own height) in twips (1/20 of a point) |
void |
setDefaultRowHeightInPoints(float height)
Sets default row height measured in point size. |
void |
setDisplayFormulas(boolean show)
Sets the flag indicating whether this sheet should display formulas. |
void |
setDisplayGridlines(boolean show)
Sets the flag indicating whether this sheet should display the lines between rows and columns to make editing and reading easier. |
void |
setDisplayGuts(boolean value)
Set whether to display the guts or not |
void |
setDisplayRowColHeadings(boolean show)
Sets the flag indicating whether this sheet should display row and column headings. |
void |
setDisplayZeros(boolean value)
Set whether the window should show 0 (zero) in cells containing zero value. |
void |
setFitToPage(boolean b)
Flag indicating whether the Fit to Page print option is enabled. |
void |
setHorizontallyCenter(boolean value)
Center on page horizontally when printing. |
void |
setMargin(short margin,
double size)
Sets the size of the margin in inches. |
void |
setPrintGridlines(boolean value)
Turns on or off the printing of gridlines. |
void |
setRowBreak(int row)
Sets a page break at the indicated row |
void |
setRowGroupCollapsed(int rowIndex,
boolean collapse)
group the row It is possible for collapsed to be false and yet still have the rows in question hidden. |
void |
setRowSumsBelow(boolean value)
Flag indicating whether summary rows appear below detail in an outline, when applying an outline. |
void |
setRowSumsRight(boolean value)
Flag indicating whether summary columns appear to the right of detail in an outline, when applying an outline. |
void |
setSelected(boolean value)
Sets a flag indicating whether this sheet is selected. |
void |
setVerticallyCenter(boolean value)
Whether the output is vertically centered on the page. |
void |
setZoom(int scale)
Window zoom magnification for current view representing percent values. |
void |
setZoom(int numerator,
int denominator)
Sets the zoom magnication for the sheet. |
void |
shiftRows(int startRow,
int endRow,
int n)
Shifts rows between startRow and endRow n number of rows. |
void |
shiftRows(int startRow,
int endRow,
int n,
boolean copyRowHeight,
boolean resetOriginalRowHeight)
Shifts rows between startRow and endRow n number of rows. |
void |
showInPane(short toprow,
short leftcol)
Location of the top left visible cell Location of the top left visible cell in the bottom right pane (when in Left-to-Right mode). |
void |
ungroupColumn(int fromColumn,
int toColumn)
|
void |
ungroupRow(int fromRow,
int toRow)
Ungroup a range of rows that were previously groupped |
Methods inherited from class org.apache.poi.POIXMLDocumentPart |
---|
createRelationship, createRelationship, getPackagePart, getPackageRelationship, getParent, getRelations, removeRelation, toString |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public org.apache.poi.ss.usermodel.Workbook getWorkbook()
getWorkbook
in interface org.apache.poi.ss.usermodel.Sheet
public org.openxmlformats.schemas.spreadsheetml.x2006.main.CTWorksheet getCTWorksheet()
public ColumnHelper getColumnHelper()
public java.lang.String getSheetName()
getSheetName
in interface org.apache.poi.ss.usermodel.Sheet
public int addMergedRegion(org.apache.poi.ss.util.CellRangeAddress region)
addMergedRegion
in interface org.apache.poi.ss.usermodel.Sheet
region
- (rowfrom/colfrom-rowto/colto) to merge
public void autoSizeColumn(int column)
autoSizeColumn
in interface org.apache.poi.ss.usermodel.Sheet
column
- the column indexpublic void autoSizeColumn(int column, boolean useMergedCells)
This process can be relatively slow on large sheets, so this should normally only be called once per column, at the end of your processing.
You can specify whether the content of merged cells should be considered or ignored. Default is to ignore merged cells.
autoSizeColumn
in interface org.apache.poi.ss.usermodel.Sheet
column
- the column indexuseMergedCells
- whether to use the contents of merged cells when calculating the width of the columnpublic org.apache.poi.ss.usermodel.Drawing createDrawingPatriarch()
createDrawingPatriarch
in interface org.apache.poi.ss.usermodel.Sheet
public void createFreezePane(int colSplit, int rowSplit)
createFreezePane
in interface org.apache.poi.ss.usermodel.Sheet
colSplit
- Horizonatal position of split.rowSplit
- Vertical position of split.public void createFreezePane(int colSplit, int rowSplit, int leftmostColumn, int topRow)
createFreezePane
in interface org.apache.poi.ss.usermodel.Sheet
colSplit
- Horizonatal position of split.rowSplit
- Vertical position of split.topRow
- Top row visible in bottom paneleftmostColumn
- Left column visible in right pane.public org.apache.poi.ss.usermodel.Comment createComment()
(org.apache.poi.ss.usermodel.ClientAnchor)
instead
public org.apache.poi.ss.usermodel.Row createRow(int rownum)
createRow
in interface org.apache.poi.ss.usermodel.Sheet
rownum
- row number
XSSFRow
object representing a row in the sheetremoveRow(org.apache.poi.ss.usermodel.Row)
public void createSplitPane(int xSplitPos, int ySplitPos, int leftmostColumn, int topRow, int activePane)
createSplitPane
in interface org.apache.poi.ss.usermodel.Sheet
xSplitPos
- Horizonatal position of split (in 1/20th of a point).ySplitPos
- Vertical position of split (in 1/20th of a point).topRow
- Top row visible in bottom paneleftmostColumn
- Left column visible in right pane.activePane
- Active pane. One of: PANE_LOWER_RIGHT,
PANE_UPPER_RIGHT, PANE_LOWER_LEFT, PANE_UPPER_LEFTSheet.PANE_LOWER_LEFT
,
Sheet.PANE_LOWER_RIGHT
,
Sheet.PANE_UPPER_LEFT
,
Sheet.PANE_UPPER_RIGHT
public org.apache.poi.ss.usermodel.Comment getCellComment(int row, int column)
getCellComment
in interface org.apache.poi.ss.usermodel.Sheet
public org.apache.poi.ss.usermodel.Hyperlink getHyperlink(int row, int column)
public int[] getColumnBreaks()
getColumnBreaks
in interface org.apache.poi.ss.usermodel.Sheet
null
public int getColumnWidth(int columnIndex)
Note, the returned value is always gerater that getDefaultColumnWidth()
because the latter does not include margins.
Actual column width measured as the number of characters of the maximum digit width of the
numbers 0, 1, 2, ..., 9 as rendered in the normal style's font. There are 4 pixels of margin
padding (two on each side), plus 1 pixel padding for the gridlines.
getColumnWidth
in interface org.apache.poi.ss.usermodel.Sheet
columnIndex
- - the column to set (0-based)
public int getDefaultColumnWidth()
Note, this value is different from getColumnWidth(int)
. The latter is always greater and includes
4 pixels of margin padding (two on each side), plus 1 pixel padding for the gridlines.
getDefaultColumnWidth
in interface org.apache.poi.ss.usermodel.Sheet
public short getDefaultRowHeight()
getDefaultRowHeight
in interface org.apache.poi.ss.usermodel.Sheet
public float getDefaultRowHeightInPoints()
getDefaultRowHeightInPoints
in interface org.apache.poi.ss.usermodel.Sheet
public org.apache.poi.ss.usermodel.CellStyle getColumnStyle(int column)
getColumnStyle
in interface org.apache.poi.ss.usermodel.Sheet
public boolean getDisplayGuts()
getDisplayGuts
in interface org.apache.poi.ss.usermodel.Sheet
public void setDisplayGuts(boolean value)
setDisplayGuts
in interface org.apache.poi.ss.usermodel.Sheet
value
- - guts or no gutspublic boolean isDisplayZeros()
isDisplayZeros
in interface org.apache.poi.ss.usermodel.Sheet
public void setDisplayZeros(boolean value)
setDisplayZeros
in interface org.apache.poi.ss.usermodel.Sheet
value
- whether to display or hide all zero values on the worksheetpublic int getFirstRowNum()
getFirstRowNum
in interface org.apache.poi.ss.usermodel.Sheet
public boolean getFitToPage()
getFitToPage
in interface org.apache.poi.ss.usermodel.Sheet
true
public org.apache.poi.ss.usermodel.Footer getFooter()
getFirstFooter()
,
getOddFooter()
and
getEvenFooter()
getFooter
in interface org.apache.poi.ss.usermodel.Sheet
public org.apache.poi.ss.usermodel.Header getHeader()
getFirstHeader()
,
getOddHeader()
and
getEvenHeader()
getHeader
in interface org.apache.poi.ss.usermodel.Sheet
public org.apache.poi.ss.usermodel.Footer getOddFooter()
public org.apache.poi.ss.usermodel.Footer getEvenFooter()
public org.apache.poi.ss.usermodel.Footer getFirstFooter()
public org.apache.poi.ss.usermodel.Header getOddHeader()
public org.apache.poi.ss.usermodel.Header getEvenHeader()
public org.apache.poi.ss.usermodel.Header getFirstHeader()
public boolean getHorizontallyCenter()
getHorizontallyCenter
in interface org.apache.poi.ss.usermodel.Sheet
public int getLastRowNum()
getLastRowNum
in interface org.apache.poi.ss.usermodel.Sheet
public short getLeftCol()
getLeftCol
in interface org.apache.poi.ss.usermodel.Sheet
public double getMargin(short margin)
getMargin
in interface org.apache.poi.ss.usermodel.Sheet
margin
- which margin to get
Sheet.LeftMargin
,
Sheet.RightMargin
,
Sheet.TopMargin
,
Sheet.BottomMargin
,
Sheet.HeaderMargin
,
Sheet.FooterMargin
public void setMargin(short margin, double size)
setMargin
in interface org.apache.poi.ss.usermodel.Sheet
margin
- which margin to getsize
- the size of the marginSheet.LeftMargin
,
Sheet.RightMargin
,
Sheet.TopMargin
,
Sheet.BottomMargin
,
Sheet.HeaderMargin
,
Sheet.FooterMargin
public org.apache.poi.ss.util.CellRangeAddress getMergedRegion(int index)
getMergedRegion
in interface org.apache.poi.ss.usermodel.Sheet
java.lang.IllegalStateException
- if this worksheet does not contain merged regionspublic int getNumMergedRegions()
getNumMergedRegions
in interface org.apache.poi.ss.usermodel.Sheet
public int getNumHyperlinks()
public org.apache.poi.hssf.util.PaneInformation getPaneInformation()
getPaneInformation
in interface org.apache.poi.ss.usermodel.Sheet
public int getPhysicalNumberOfRows()
getPhysicalNumberOfRows
in interface org.apache.poi.ss.usermodel.Sheet
public org.apache.poi.ss.usermodel.PrintSetup getPrintSetup()
getPrintSetup
in interface org.apache.poi.ss.usermodel.Sheet
public boolean getProtect()
getProtect
in interface org.apache.poi.ss.usermodel.Sheet
public void protectSheet(java.lang.String password)
CTSheetProtection
that correspond to
the default values used by Excel
protectSheet
in interface org.apache.poi.ss.usermodel.Sheet
password
- to set for protection. Pass null
to remove protectionpublic org.apache.poi.ss.usermodel.Row getRow(int rownum)
getRow
in interface org.apache.poi.ss.usermodel.Sheet
rownum
- row to get
XSSFRow
representing the rownumber or null
if its not defined on the sheetpublic int[] getRowBreaks()
getRowBreaks
in interface org.apache.poi.ss.usermodel.Sheet
null
public boolean getRowSumsBelow()
When true a summary row is inserted below the detailed data being summarized and a new outline level is established on that row.
When false a summary row is inserted above the detailed data being summarized and a new outline level is established on that row.
getRowSumsBelow
in interface org.apache.poi.ss.usermodel.Sheet
true
if row summaries appear below detail in the outlinepublic void setRowSumsBelow(boolean value)
When true a summary row is inserted below the detailed data being summarized and a new outline level is established on that row.
When false a summary row is inserted above the detailed data being summarized and a new outline level is established on that row.
setRowSumsBelow
in interface org.apache.poi.ss.usermodel.Sheet
value
- true
if row summaries appear below detail in the outlinepublic boolean getRowSumsRight()
When true a summary column is inserted to the right of the detailed data being summarized and a new outline level is established on that column.
When false a summary column is inserted to the left of the detailed data being summarized and a new outline level is established on that column.
getRowSumsRight
in interface org.apache.poi.ss.usermodel.Sheet
true
if col summaries appear right of the detail in the outlinepublic void setRowSumsRight(boolean value)
When true a summary column is inserted to the right of the detailed data being summarized and a new outline level is established on that column.
When false a summary column is inserted to the left of the detailed data being summarized and a new outline level is established on that column.
setRowSumsRight
in interface org.apache.poi.ss.usermodel.Sheet
value
- true
if col summaries appear right of the detail in the outlinepublic boolean getScenarioProtect()
getScenarioProtect
in interface org.apache.poi.ss.usermodel.Sheet
public short getTopRow()
getTopRow
in interface org.apache.poi.ss.usermodel.Sheet
public boolean getVerticallyCenter()
getVerticallyCenter
in interface org.apache.poi.ss.usermodel.Sheet
public void groupColumn(int fromColumn, int toColumn)
groupColumn
in interface org.apache.poi.ss.usermodel.Sheet
public void groupRow(int fromRow, int toRow)
groupRow
in interface org.apache.poi.ss.usermodel.Sheet
fromRow
- start row (0-based)toRow
- end row (0-based)public boolean isColumnBroken(int column)
isColumnBroken
in interface org.apache.poi.ss.usermodel.Sheet
public boolean isColumnHidden(int columnIndex)
isColumnHidden
in interface org.apache.poi.ss.usermodel.Sheet
columnIndex
- - the column to set (0-based)
false
if the column is visiblepublic boolean isDisplayFormulas()
isDisplayFormulas
in interface org.apache.poi.ss.usermodel.Sheet
true
if this sheet should display formulas.public boolean isDisplayGridlines()
isDisplayGridlines
in interface org.apache.poi.ss.usermodel.Sheet
true
if this sheet displays gridlines.to check if printing of gridlines is turned on or off
public void setDisplayGridlines(boolean show)
setPrintGridlines(boolean)
setDisplayGridlines
in interface org.apache.poi.ss.usermodel.Sheet
show
- true
if this sheet should display gridlines.setPrintGridlines(boolean)
public boolean isDisplayRowColHeadings()
Row heading are the row numbers to the side of the sheet
Column heading are the letters or numbers that appear above the columns of the sheet
isDisplayRowColHeadings
in interface org.apache.poi.ss.usermodel.Sheet
true
if this sheet should display row and column headings.public void setDisplayRowColHeadings(boolean show)
Row heading are the row numbers to the side of the sheet
Column heading are the letters or numbers that appear above the columns of the sheet
setDisplayRowColHeadings
in interface org.apache.poi.ss.usermodel.Sheet
show
- true
if this sheet should display row and column headings.public boolean isPrintGridlines()
isPrintGridlines
in interface org.apache.poi.ss.usermodel.Sheet
public void setPrintGridlines(boolean value)
setPrintGridlines
in interface org.apache.poi.ss.usermodel.Sheet
value
- boolean to turn on or off the printing of gridlinespublic boolean isRowBroken(int row)
isRowBroken
in interface org.apache.poi.ss.usermodel.Sheet
row
- index of the row to test
true
if there is a page break at the indicated rowpublic void setRowBreak(int row)
setRowBreak
in interface org.apache.poi.ss.usermodel.Sheet
public void removeColumnBreak(int column)
removeColumnBreak
in interface org.apache.poi.ss.usermodel.Sheet
public void removeMergedRegion(int index)
removeMergedRegion
in interface org.apache.poi.ss.usermodel.Sheet
index
- of the region to unmergepublic void removeRow(org.apache.poi.ss.usermodel.Row row)
removeRow
in interface org.apache.poi.ss.usermodel.Sheet
row
- the row to remove.public void removeRowBreak(int row)
removeRowBreak
in interface org.apache.poi.ss.usermodel.Sheet
public java.util.Iterator rowIterator()
rowIterator
in interface org.apache.poi.ss.usermodel.Sheet
public java.util.Iterator iterator()
rowIterator()
to
allow foreach loops
iterator
in interface poi.support.Iterable
public boolean getAutobreaks()
getAutobreaks
in interface org.apache.poi.ss.usermodel.Sheet
true
if the sheet displays Automatic Page Breaks.public void setAutobreaks(boolean value)
setAutobreaks
in interface org.apache.poi.ss.usermodel.Sheet
value
- true
if the sheet displays Automatic Page Breaks.public void setColumnBreak(int column)
setColumnBreak
in interface org.apache.poi.ss.usermodel.Sheet
column
- the column to breakpublic void setColumnGroupCollapsed(int columnNumber, boolean collapsed)
setColumnGroupCollapsed
in interface org.apache.poi.ss.usermodel.Sheet
public void setColumnHidden(int columnIndex, boolean hidden)
setColumnHidden
in interface org.apache.poi.ss.usermodel.Sheet
columnIndex
- - the column to get (0-based)hidden
- - the visiblity state of the columnpublic void setColumnWidth(int columnIndex, int width)
The maximum column width for an individual cell is 255 characters. This value represents the number of characters that can be displayed in a cell that is formatted with the standard font.
setColumnWidth
in interface org.apache.poi.ss.usermodel.Sheet
columnIndex
- - the column to set (0-based)width
- - the width in units of 1/256th of a character width
java.lang.IllegalArgumentException
- if width > 65280 (the maximum column width in Excel)public void setDefaultColumnStyle(int column, org.apache.poi.ss.usermodel.CellStyle style)
setDefaultColumnStyle
in interface org.apache.poi.ss.usermodel.Sheet
public void setDefaultColumnWidth(int width)
setDefaultColumnWidth
in interface org.apache.poi.ss.usermodel.Sheet
width
- the number of characters. Default value is 8
.public void setDefaultRowHeight(short height)
setDefaultRowHeight
in interface org.apache.poi.ss.usermodel.Sheet
height
- default row height in twips (1/20 of a point)public void setDefaultRowHeightInPoints(float height)
setDefaultRowHeightInPoints
in interface org.apache.poi.ss.usermodel.Sheet
height
- default row height measured in point size.public void setDisplayFormulas(boolean show)
setDisplayFormulas
in interface org.apache.poi.ss.usermodel.Sheet
show
- true
if this sheet should display formulas.public void setFitToPage(boolean b)
setFitToPage
in interface org.apache.poi.ss.usermodel.Sheet
b
- true
if the Fit to Page print option is enabled.public void setHorizontallyCenter(boolean value)
setHorizontallyCenter
in interface org.apache.poi.ss.usermodel.Sheet
value
- whether to center on page horizontally when printing.public void setVerticallyCenter(boolean value)
setVerticallyCenter
in interface org.apache.poi.ss.usermodel.Sheet
value
- true to vertically center, false otherwise.public void setRowGroupCollapsed(int rowIndex, boolean collapse)
setRowGroupCollapsed
in interface org.apache.poi.ss.usermodel.Sheet
rowIndex
- -
the row involved, 0 basedcollapse
- -
boolean value for collapsepublic int findEndOfRowOutlineGroup(int row)
row
- the zero based row index to find frompublic void setZoom(int numerator, int denominator)
setZoom
in interface org.apache.poi.ss.usermodel.Sheet
numerator
- The numerator for the zoom magnification.denominator
- The denominator for the zoom magnification.setZoom(int)
public void setZoom(int scale)
10 - 10% 20 - 20% ... 100 - 100% ... 400 - 400%Current view can be Normal, Page Layout, or Page Break Preview.
scale
- window zoom magnification
java.lang.IllegalArgumentException
- if scale is invalidpublic void shiftRows(int startRow, int endRow, int n)
Additionally shifts merged regions that are completely defined in these rows (ie. merged 2 cells on a row to be shifted).
shiftRows
in interface org.apache.poi.ss.usermodel.Sheet
startRow
- the row to start shiftingendRow
- the row to end shiftingn
- the number of rows to shiftpublic void shiftRows(int startRow, int endRow, int n, boolean copyRowHeight, boolean resetOriginalRowHeight)
Additionally shifts merged regions that are completely defined in these rows (ie. merged 2 cells on a row to be shifted).
shiftRows
in interface org.apache.poi.ss.usermodel.Sheet
startRow
- the row to start shiftingendRow
- the row to end shiftingn
- the number of rows to shiftcopyRowHeight
- whether to copy the row height during the shiftresetOriginalRowHeight
- whether to set the original row's height to the defaultpublic void showInPane(short toprow, short leftcol)
showInPane
in interface org.apache.poi.ss.usermodel.Sheet
toprow
- the top row to show in desktop window paneleftcol
- the left column to show in desktop window panepublic void ungroupColumn(int fromColumn, int toColumn)
ungroupColumn
in interface org.apache.poi.ss.usermodel.Sheet
public void ungroupRow(int fromRow, int toRow)
ungroupRow
in interface org.apache.poi.ss.usermodel.Sheet
fromRow
- start row (0-based)toRow
- end row (0-based)public boolean isSelected()
When only 1 sheet is selected and active, this value should be in synch with the activeTab value. In case of a conflict, the Start Part setting wins and sets the active sheet tab.
Note: multiple sheets can be selected, but only one sheet can be active at one time.
isSelected
in interface org.apache.poi.ss.usermodel.Sheet
true
if this sheet is selectedpublic void setSelected(boolean value)
When only 1 sheet is selected and active, this value should be in synch with the activeTab value. In case of a conflict, the Start Part setting wins and sets the active sheet tab.
Note: multiple sheets can be selected, but only one sheet can be active at one time.
setSelected
in interface org.apache.poi.ss.usermodel.Sheet
value
- true
if this sheet is selectedpublic static void setCellComment(java.lang.String cellRef, XSSFComment comment)
cellRef
- cell regioncomment
- the comment to assign
since Nov 2009 use XSSFCell.setCellComment(org.apache.poi.ss.usermodel.Comment)
insteadpublic java.lang.String getActiveCell()
A1
.
public void setActiveCell(java.lang.String cellRef)
cellRef
- the location of the active cell, e.g. A1
..public boolean hasComments()
public boolean isAutoFilterLocked()
public boolean isDeleteColumnsLocked()
public boolean isDeleteRowsLocked()
public boolean isFormatCellsLocked()
public boolean isFormatColumnsLocked()
public boolean isFormatRowsLocked()
public boolean isInsertColumnsLocked()
public boolean isInsertHyperlinksLocked()
public boolean isInsertRowsLocked()
public boolean isPivotTablesLocked()
public boolean isSortLocked()
public boolean isObjectsLocked()
public boolean isScenariosLocked()
public boolean isSelectLockedCellsLocked()
public boolean isSelectUnlockedCellsLocked()
public boolean isSheetLocked()
public void enableLocking()
public void disableLocking()
public void lockAutoFilter()
enableLocking()
public void lockDeleteColumns()
enableLocking()
public void lockDeleteRows()
enableLocking()
public void lockFormatCells()
enableLocking()
public void lockFormatColumns()
enableLocking()
public void lockFormatRows()
enableLocking()
public void lockInsertColumns()
enableLocking()
public void lockInsertHyperlinks()
enableLocking()
public void lockInsertRows()
enableLocking()
public void lockPivotTables()
enableLocking()
public void lockSort()
enableLocking()
public void lockObjects()
enableLocking()
public void lockScenarios()
enableLocking()
public void lockSelectLockedCells()
enableLocking()
public void lockSelectUnlockedCells()
enableLocking()
public org.apache.poi.ss.usermodel.CellRange setArrayFormula(java.lang.String formula, org.apache.poi.ss.util.CellRangeAddress range)
setArrayFormula
in interface org.apache.poi.ss.usermodel.Sheet
public org.apache.poi.ss.usermodel.CellRange removeArrayFormula(org.apache.poi.ss.usermodel.Cell cell)
removeArrayFormula
in interface org.apache.poi.ss.usermodel.Sheet
public org.apache.poi.ss.usermodel.DataValidationHelper getDataValidationHelper()
getDataValidationHelper
in interface org.apache.poi.ss.usermodel.Sheet
public java.util.List getDataValidations()
public void addValidationData(org.apache.poi.ss.usermodel.DataValidation dataValidation)
addValidationData
in interface org.apache.poi.ss.usermodel.Sheet
public org.apache.poi.ss.usermodel.AutoFilter setAutoFilter(org.apache.poi.ss.util.CellRangeAddress range)
setAutoFilter
in interface org.apache.poi.ss.usermodel.Sheet
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |