| Modifier and Type | Field and Description |
|---|---|
| protected final InternalWorkbook | |
| private int | |
| private int | |
| private HSSFPatriarch | |
| private final TreeMap | _rows
stores rows by zero-based row number |
| private final InternalSheet | _sheet
reference to the low level |
| protected final HSSFWorkbook | |
| public static final int | INITIAL_CAPACITY
Used for compile-time optimization. |
| private static final Logger | |
| private static final float | PX_DEFAULT
width of 1px in columns with default width in units of 1/256 of a character width |
| private static final float | PX_MODIFIED
width of 1px in columns with overridden width in units of 1/256 of a character width |
| Access | Constructor and Description |
|---|---|
| protected | HSSFSheet(HSSFWorkbook
- The HSSF Workbook object associated with the sheet. workbook)Creates new HSSFSheet - called by HSSFWorkbook to create a sheet from scratch. |
| protected | HSSFSheet(HSSFWorkbook
- The HSSF Workbook object associated with the sheet. workbook, InternalSheet - lowlevel Sheet object this sheet will represent sheet)Creates an HSSFSheet representing the given Sheet object. |
| Modifier and Type | Method and Description |
|---|---|
| public int | Returns: index of this regionto merge region)Implements org. Adds a merged region of cells on a sheet. |
| private int | Returns: index of this region(rowfrom/colfrom-rowto/colto) to merge region, boolean whether to validate merged region validate)adds a merged region of cells (hence those cells form one) |
| public int | Returns: index of this regionto merge region)Implements org. Adds a merged region of cells (hence those cells form one). |
| private void | |
| public void | addValidationData(DataValidation
The Data validation object settings dataValidation)Implements org. Creates a data validation object |
| public void | autoSizeColumn(int
the column index column)Implements org. Adjusts the column width to fit the contents. |
| public void | autoSizeColumn(int
the column index column, boolean whether to use the contents of merged cells when calculating the width of the column useMergedCells)Implements org. Adjusts the column width to fit the contents. |
| private void | checkForIntersectingMergedRegions()
Verify that no merged regions intersect another merged region in this sheet. |
| private void | checkForMergedRegionsIntersectingArrayFormulas()
Verify that none of the merged regions intersect a multi-cell array formula in this sheet |
| private static int | |
| pack-priv HSSFSheet | |
| public HSSFPatriarch | Returns: The new patriarch.Implements org. Creates the top-level drawing patriarch. |
| public void | createFreezePane(int
Horizontal position of split. colSplit, int Vertical position of split. rowSplit, int Left column visible in right pane. leftmostColumn, int Top row visible in bottom pane topRow)Implements org. Creates a split (freezepane). |
| public void | createFreezePane(int
Horizontal position of split. colSplit, int Vertical position of split. rowSplit)Implements org. Creates a split (freezepane). |
| public HSSFRow | Returns: High level HSSFRow object representing a row in the sheetrow number rownum)Implements org. Create a new row within the sheet and return the high level representation |
| private HSSFRow | Returns: HSSFRow high level representationlow level record to represent as a high level Row and add to sheet row)Used internally to create a high level Row object from a low level row object. |
| public void | createSplitPane(int
Horizontal position of split (in 1/20th of a point). xSplitPos, int Vertical position of split (in 1/20th of a point). ySplitPos, int Left column visible in right pane. leftmostColumn, int Top row visible in bottom pane topRow, int Active pane. One of: PANE_LOWER_RIGHT,
PANE_UPPER_RIGHT, PANE_LOWER_LEFT, PANE_UPPER_LEFT activePane)Implements org.
Deprecated
use
createSplitPane(int, int, int, int, PaneType)
Creates a split pane. |
| public void | createSplitPane(int
Horizontal position of split (in 1/20th of a point). xSplitPos, int Vertical position of split (in 1/20th of a point). ySplitPos, int Left column visible in right pane. leftmostColumn, int Top row visible in bottom pane topRow, PaneType Active pane. activePane)Implements org. Creates a split pane. |
| private void | |
| public void | dumpDrawingRecords(boolean fat, PrintWriter pw)
Aggregates the drawing records and dumps the escher record hierarchy to the standard output. |
| protected HSSFComment | |
| private void | findCellCommentLocations(HSSFShapeContainer
a container that may contain HSSFComments container, Map<CellAddress, HSSFComment> the map to store the HSSFComments in locations)Finds all cell comments in this sheet and adds them to the specified locations map |
| private int | |
| private int | |
| public CellAddress | getActiveCell()
Implements org. Return location of the active cell, e.g. |
| public boolean | Returns: alternative expression evaluation or notwhether alternate expression evaluation is on |
| public boolean | |
| public boolean | Returns: whether to show auto page breaksImplements org. show automatic page breaks or not |
| private NameRecord | |
| public HSSFComment | Returns: cell comment ornull if not foundImplements org. Returns cell comment for the specified row and column |
| public Map | Returns: A map of each Comment in the sheet, keyed on the cell address where the comment is located.Implements org. Returns all cell comments on this sheet. |
| private CellRange | |
| public int[] | Returns: column indexes of all the vertical page breaks, nevernullImplements org. Retrieves all the vertical page breaks |
| public int | getColumnOutlineLevel(int columnIndex)
Implements org. Returns the column outline level. |
| public HSSFCellStyle | getColumnStyle(int column)
Implements org. Returns the HSSFCellStyle that applies to the given (0 based) column, or null if no style has been set for that column |
| public int | Returns: width - the width in units of 1/256th of a character width- the column to set (0-based) columnIndex)Implements org. get the width (in units of 1/256th of a character width ) |
| public float | getColumnWidthInPixels(int
- the column to set (0-based) column)Implements org. get the width in pixel Please note, that this method works correctly only for workbooks with the default font size (Arial 10pt for .xls and Calibri 11pt for .xlsx). |
| public DataValidationHelper | |
| public List | getDataValidations()
Implements org. Returns the list of DataValidation in the sheet. |
| public int | Returns: default column widthImplements org. get the default column width for the sheet (if the columns do not define their own width) in characters |
| public short | Returns: default row heightImplements org. get the default row height for the sheet (if the rows do not define their own height) in twips (1/20 of a point) |
| public float | Returns: default row height in pointsImplements org. get the default row height for the sheet (if the rows do not define their own height) in points. |
| public boolean | |
| public boolean | Returns: guts or no guts (or glory)Implements org. get whether to display the guts or not |
| public EscherAggregate | |
| public HSSFPatriarch | Returns: the top-level drawing patriarch, if there is one, else returns nullImplements org. This will hold any graphics or charts for the sheet. |
| public int | Returns: the number of the first logical row on the sheet, zero basedImplements org. Gets the first row on the sheet |
| public boolean | Returns: fit or notImplements org. fit to page option is on |
| public HSSFFooter | getFooter()
Implements org. Gets the user model for the default document footer. |
| public boolean | Returns: true if an uncalced record must be inserted or not at generationImplements org. Whether a record must be inserted or not at generation to indicate that formula must be recalculated when workbook is opened. |
| public HSSFHeader | getHeader()
Implements org. Gets the user model for the default document header. |
| public boolean | getHorizontallyCenter()
Implements org. Determine whether printed output for this sheet will be horizontally centered. |
| public HSSFHyperlink | Returns: hyperlink if there is a hyperlink anchored at row, column; otherwise returns nullThe index of the row of the hyperlink, zero-based row, int the index of the column of the hyperlink, zero-based column)Implements org. Get a Hyperlink in this sheet anchored at row, column |
| public HSSFHyperlink | Returns: hyperlink if there is a hyperlink anchored ataddr; otherwise returns nullThe address of the cell containing the hyperlink addr)Implements org. Get a Hyperlink in this sheet located in a cell specified by {code addr} |
| public List | Returns: Hyperlinks for the sheetImplements org. Get a list of Hyperlinks in this sheet |
| public int | Returns: the number of the last row contained in this sheet, zero based.Implements org. Gets the number last row on the sheet. |
| public short | Returns: short indicating the rownum (0 based) of the top rowImplements org. The left col in the visible view when the sheet is first viewed after opening it in a viewer |
| public double | Returns: the size of the marginwhich margin to get margin)Implements org.
Deprecated
use
getMargin(PageMargin)
Gets the size of the margin in inches. |
| public double | Returns: the size of the marginwhich margin to get margin)Implements org. Gets the size of the margin in inches. |
| public CellRangeAddress | Returns: the merged region at the specified indexImplements org. Returns the merged region at the specified index |
| public List | Returns: the list of merged regionsImplements org. Returns the list of merged regions. |
| public int | Returns: number of merged regionsImplements org. returns the number of merged regions |
| public boolean | Returns: true => protection enabled; false => protection disabledAnswer whether object protection is enabled or disabled |
| public PaneInformation | Returns: null if no pane configured, or the pane information.Implements org. Returns the information regarding the currently configured pane (split or freeze). |
| public short | |
| private HSSFPatriarch | |
| public int | getPhysicalNumberOfRows()
Implements org. Returns the number of physically defined rows (NOT the number of rows in the sheet) |
| public HSSFPrintSetup | Returns: The user model for the print setup object.Implements org. Gets the print setup object. |
| public boolean | Returns: true => protection enabled; false => protection disabledImplements org. Answer whether protection is enabled or disabled |
| private WorksheetProtectionBlock | |
| public CellRangeAddress | getRepeatingColumns()
Implements org. Gets the repeating columns used when printing the sheet, as found in File->PageSetup->Sheet. |
| public CellRangeAddress | getRepeatingRows()
Implements org. Gets the repeating rows used when printing the sheet, as found in File->PageSetup->Sheet. |
| private CellRangeAddress | |
| public HSSFRow | Returns: HSSFRow representing the row number or null if its not defined on the sheetrow to get rowIndex)Implements org. Returns the logical row (not physical) 0-based. |
| public int[] | Returns: row indexes of all the horizontal page breaks, nevernullImplements org. Retrieves all the horizontal page breaks |
| public boolean | Returns: below or notImplements org. get if row summaries appear below detail in the outline |
| public boolean | Returns: right or notImplements org. get if col summaries appear right of the detail in the outline |
| public boolean | Returns: true => protection enabled; false => protection disabledImplements org. Answer whether scenario protection is enabled or disabled |
| public InternalSheet | Returns: Sheet - low level representation of this HSSFSheet.used internally in the API to get the low level Sheet record represented by this Object. |
| public HSSFSheetConditionalFormatting | getSheetConditionalFormatting()
Implements org. The 'Conditional Formatting' facet for this |
| public String | Returns: the name of this sheetImplements org. Returns the name of this sheet |
| public short | Returns: short indicating the rownum (0 based) of the top rowImplements org. The top row in the visible view when the sheet is first viewed after opening it in a viewer |
| public boolean | getVerticallyCenter()
Implements org. Determine whether printed output for this sheet will be vertically centered. |
| public HSSFWorkbook | Returns: the parent workbookImplements org. Return the parent workbook |
| public void | groupColumn(int
beginning of the column range. fromColumn, int end of the column range. toColumn)Implements org. Create an outline for the provided column range. |
| public void | groupRow(int
start row (0-based) fromRow, int end row (0-based) toRow)Implements org. Tie a range of cell together so that they can be collapsed or expanded |
| protected void | |
| public boolean | |
| public boolean | Returns: FIXME: Document this!FIXME: Document this! column)Implements org. Determines if there is a page break at the indicated column |
| public boolean | Returns: hidden -false if the column is visible- the column to set (0-based) columnIndex)Implements org. Get the hidden state for a given column. |
| public boolean | Returns: whether formulas are displayedImplements org. Returns if formulas are displayed. |
| public boolean | Returns: whether gridlines are displayedImplements org. Returns if gridlines are displayed. |
| public boolean | Returns: whether RowColHeadings are displayedImplements org. Returns if RowColHeadings are displayed. |
| public boolean | Returns: whether all zero values on the worksheet are displayedImplements org. Gets the flag indicating whether the window should show 0 (zero) in cells containing zero value. |
| public boolean | |
| public boolean | Returns: Gridlines are printedImplements org. Returns whether gridlines are printed. |
| public boolean | Returns: row and column headings are printedImplements org. Returns whether row and column headings are printed. |
| public boolean | Returns: whether the text is displayed in right-to-left mode in the windowImplements org. Whether the text is displayed in right-to-left mode in the window |
| public boolean | Returns: true if there is a page break at the indicated rowFIXME: Document this! row)Implements org. Determines if there is a page break at the indicated row |
| public boolean | Returns: true if this sheet is currently selectedImplements org. Note - this is not the same as whether the sheet is focused (isActive) |
| private HSSFComment | |
| private void | |
| private void | |
| protected void | |
| public void | protectSheet(String
to set for protection. Pass password)null to remove protectionImplements org. Sets the protection enabled as well as the password |
| private void | |
| public CellRange | removeArrayFormula(Cell
any cell within Array Formula range cell)Implements org. Remove a Array Formula from this sheet. |
| public void | removeColumnBreak(int
The index of the column for which to remove a page-break, zero-based column)Implements org. Removes a page break at the indicated column |
| protected void | removeHyperlink(HSSFHyperlink
the HSSFHyperlink wrapper around the HyperlinkRecord to remove link)Remove the underlying HyperlinkRecord from this sheet. |
| protected void | removeHyperlink(HyperlinkRecord
the underlying HyperlinkRecord to remove from this sheet link)Remove the underlying HyperlinkRecord from this sheet |
| public void | removeMergedRegion(int
of the region to unmerge index)Implements org. removes a merged region of cells (hence letting them free) |
| public void | removeMergedRegions(Collection<Integer>
A set of the regions to unmerge indices)Implements org. Removes a number of merged regions of cells (hence letting them free) |
| public void | removeRow(Row
representing a row to remove. row)Implements org. Remove a row from this sheet. |
| public void | removeRowBreak(int
The 0-based index of the row. row)Implements org. Removes the page break at the indicated row |
| public Iterator | Returns: an iterator of the PHYSICAL rows. Meaning the 3rd element may not be the third row if say for instance the second row is undefined. Call getRowNum() on each row if you care which one it is.Implements org. Returns an iterator of the physical rows |
| public void | setActive(boolean
Whether to select the sheet or deselect the sheet. sel)Sets whether sheet is selected. |
| public void | setActiveCell(CellAddress
the location of the active cell, e.g. address)A1.Implements org. Sets location of the active cell |
| public void | setAlternativeExpression(boolean
alternative expression evaluation or not b)whether alternate expression evaluation is on |
| public void | |
| public CellRange | setArrayFormula(String
text representation of the formula formula, CellRangeAddress Region of array formula for result. range)Implements org. Sets array formula to specified region for result. |
| public void | setAutobreaks(boolean
whether to show auto page breaks b)Implements org. show automatic page breaks or not |
| public HSSFAutoFilter | setAutoFilter(CellRangeAddress
the range of cells to filter range)Implements org. Enable filtering for a range of cells |
| public void | setColumnBreak(int
the column to break, inclusive column)Implements org. Sets a page break at the indicated column. |
| public void | setColumnGroupCollapsed(int
One of the columns in the group. columnNumber, boolean true = collapse group, false = expand group. collapsed)Implements org. Expands or collapses a column group. |
| public void | setColumnHidden(int
- the column to get (0-based) columnIndex, boolean - the visibility state of the column hidden)Implements org. Set the visibility state for a given column. |
| public void | setColumnWidth(int
- the column to set (0-based) columnIndex, int - the width in units of 1/256th of a character width width)Implements org. Set the width (in units of 1/256th of a character width) The maximum column width for an individual cell is 255 characters. |
| public void | setDefaultColumnStyle(int
the column index column, CellStyle the style to set style)Implements org. Sets the default column style for a given column. |
| public void | setDefaultColumnWidth(int
default column width width)Implements org. set the default column width for the sheet (if the columns do not define their own width) in characters |
| public void | setDefaultRowHeight(short
default row height height)Implements org. set the default row height for the sheet (if the rows do not define their own height) in twips (1/20 of a point) |
| public void | setDefaultRowHeightInPoints(float
default row height height)Implements org. set the default row height for the sheet (if the rows do not define their own height) in points |
| public void | |
| public void | setDisplayFormulas(boolean
whether to show formulas or not show)Implements org. Sets whether the formulas are shown in a viewer. |
| public void | setDisplayGridlines(boolean
whether to show gridlines or not show)Implements org. Sets whether the gridlines are shown in a viewer. |
| public void | setDisplayGuts(boolean
guts or no guts (or glory) b)Implements org. set whether to display the guts or not |
| public void | setDisplayRowColHeadings(boolean
whether to show RowColHeadings or not show)Implements org. Sets whether the RowColHeadings are shown in a viewer. |
| public void | setDisplayZeros(boolean
whether to display or hide all zero values on the worksheet value)Implements org. Set whether the window should show 0 (zero) in cells containing zero value. |
| public void | setFitToPage(boolean
fit or not b)Implements org. fit to page option is on |
| public void | setForceFormulaRecalculation(boolean
true if the application will perform a full recalculation of
this worksheet values when the workbook is opened value)Implements org. Control if Excel should be asked to recalculate all formulas on this sheet when the workbook is opened. |
| public void | |
| public void | setHorizontallyCenter(boolean
true to horizontally center, false otherwise. value)Implements org. determines whether the output is horizontally centered on the page. |
| public void | setMargin(short
which margin to set margin, double the size of the margin size)Implements org.
Deprecated
use
setMargin(PageMargin, double) instead
Sets the size of the margin in inches. |
| public void | setMargin(PageMargin
which margin to set margin, double the size of the margin size)Implements org. Sets the size of the margin in inches. |
| public void | setPrintGridlines(boolean
boolean to turn on or off the printing of
gridlines show)Implements org. Turns on or off the printing of gridlines. |
| public void | setPrintRowAndColumnHeadings(boolean
boolean to turn on or off the printing of
row and column headings show)Implements org. Turns on or off the printing of row and column headings. |
| private void | setPropertiesFromSheet(InternalSheet sheet)
used internally to set the properties given a Sheet object |
| public void | setRepeatingColumns(CellRangeAddress
a columnRangeRef)CellRangeAddress containing the repeating
columns for the Sheet, or null.Implements org. Sets the repeating columns used when printing the sheet, as found in File->PageSetup->Sheet. |
| public void | setRepeatingRows(CellRangeAddress
a rowRangeRef)CellRangeAddress containing the repeating
rows for the Sheet, or null.Implements org. Sets the repeating rows used when printing the sheet, as found in File->PageSetup->Sheet. |
| private void | |
| public void | setRightToLeft(boolean
true for right to left, false otherwise. value)Implements org. Sets whether the worksheet is displayed from right to left instead of from left to right. |
| public void | setRowBreak(int
the row to break, inclusive row)Implements org. Sets a page break at the indicated row Breaks occur above the specified row and left of the specified column inclusive. |
| public void | setRowGroupCollapsed(int
start row of a grouped range of rows (0-based) rowIndex, boolean whether to expand/collapse the detail rows collapse)Implements org. Set view state of a grouped range of rows |
| public void | setRowSumsBelow(boolean
below or not b)Implements org. set if row summaries appear below detail in the outline |
| public void | setRowSumsRight(boolean
right or not b)Implements org. set if col summaries appear right of the detail in the outline |
| public void | setSelected(boolean
Whether to select the sheet or deselect the sheet. sel)Implements org. Sets whether sheet is selected. |
| public void | setVerticallyCenter(boolean
true to vertically center, false otherwise. value)Implements org. determines whether the output is vertically centered on the page. |
| public void | setZoom(int
The numerator for the zoom magnification. numerator, int The denominator for the zoom magnification. denominator)Sets the zoom magnification for the sheet. |
| public void | setZoom(int
window zoom magnification scale)Implements org. Window zoom magnification for current view representing percent values. |
| public void | shiftColumns(int
the column to start shifting startColumn, int the column to end shifting endColumn, int the number of columns to shift n)Implements org. Shifts columns in range [startColumn, endColumn] for n places to the right. |
| protected void | shiftMerged(int
the start-index of the rows to shift, zero-based startRow, int the end-index of the rows to shift, zero-based endRow, int how far to shift, negative to shift up n, boolean unused, kept for backwards compatibility isRow)
Deprecated
POI 3.15 beta 2. Use
HSSFRowShifter#shiftMergedRegions(int, int, int).
Shifts, grows, or shrinks the merged regions due to a row shift |
| public void | shiftRows(int
the row to start shifting startRow, int the row to end shifting endRow, int the number of rows to shift n)Implements org. Shifts rows between startRow and endRow n number of rows. |
| public void | shiftRows(int
the row to start shifting startRow, int the row to end shifting endRow, int the number of rows to shift n, boolean whether to copy the row height during the shift copyRowHeight, boolean whether to set the original row's height to the default resetOriginalRowHeight)Implements org. Shifts rows between startRow and endRow n number of rows. |
| public void | shiftRows(int
the row to start shifting startRow, int the row to end shifting endRow, int the number of rows to shift n, boolean whether to copy the row height during the shift copyRowHeight, boolean whether to set the original row's height to the default resetOriginalRowHeight, boolean whether to move comments at the same time as the cells they are attached to moveComments)Shifts rows between startRow and endRow n number of rows. |
| public void | showInPane(int
the top row to show in desktop window pane topRow, int the left column to show in desktop window pane leftCol)Implements org. Sets desktop window pane display area, when the file is first opened in a viewer. |
| private void | showInPane(short
the top row to show in desktop window pane toprow, short the left column to show in desktop window pane leftcol)Sets desktop window pane display area, when the file is first opened in a viewer. |
| public Spliterator | Returns: a spliterator of the PHYSICAL rows. Meaning the 3rd element may not be the third row if say for instance the second row is undefined. Call getRowNum() on each row if you care which one it is.Overrides default org. Returns a spliterator of the physical rows |
| public void | ungroupColumn(int
start column (0-based) fromColumn, int end column (0-based) toColumn)Implements org. Ungroup a range of columns that were previously grouped |
| public void | ungroupRow(int
start row (0-based) fromRow, int end row (0-based) toRow)Implements org. Ungroup a range of rows that were previously grouped |
| private void | |
| private void | |
| protected void | validateColumn(int
the index of the column to validate, zero-based column)Runs a bounds check for column numbers |
| public void | validateMergedRegions()
Implements org. Verify that merged regions do not intersect multi-cell array formulas and no merged regions intersect another merged region in this sheet. |
| private void | |
| protected void |