Top Description Fields Constructors Methods
org.apache.poi.hssf.usermodel

public final Class HSSFSheet

extends Object
implements Sheet
Class Inheritance
All Implemented Interfaces
org.apache.poi.ss.usermodel.Sheet, java.lang.Iterable
Imports
java.io.PrintWriter, java.util.ArrayList, .Collection, .Iterator, .List, .Map, .Spliterator, .TreeMap, .TreeSet, org.apache.logging.log4j.LogManager, .Logger, org.apache.logging.log4j.message.SimpleMessage, org.apache.poi.ddf.EscherRecord, org.apache.poi.hssf.model.DrawingManager2, .HSSFFormulaParser, .InternalSheet, .InternalWorkbook, org.apache.poi.hssf.record.AutoFilterInfoRecord, .CellValueRecordInterface, .DVRecord, .DimensionsRecord, .DrawingRecord, .EscherAggregate, .ExtendedFormatRecord, .HyperlinkRecord, .NameRecord, .Record, .RecordBase, .RowRecord, .SCLRecord, .WSBoolRecord, .WindowTwoRecord, org.apache.poi.hssf.record.aggregates.DataValidityTable, .FormulaRecordAggregate, .RecordAggregate.RecordVisitor, .WorksheetProtectionBlock, org.apache.poi.hssf.usermodel.helpers.HSSFColumnShifter, .HSSFRowShifter, org.apache.poi.ss.SpreadsheetVersion, org.apache.poi.ss.formula.FormulaShifter, .FormulaType, org.apache.poi.ss.formula.ptg.Area3DPtg, .MemFuncPtg, .Ptg, .UnionPtg, org.apache.poi.ss.usermodel.Cell, .CellRange, .CellStyle, .DataValidation, .DataValidationHelper, .FormulaEvaluator, .PageMargin, .PaneType, .Row, .Sheet, .Workbook, org.apache.poi.ss.usermodel.helpers.RowShifter, org.apache.poi.ss.util.CellAddress, .CellRangeAddress, .CellRangeAddressList, .CellReference, .PaneInformation, .SSCellRange, .SheetUtil, org.apache.poi.util.Beta, .Configurator, .Internal, .Removal

High level representation of a worksheet.

Field Summary

Modifier and TypeField and Description
protected final InternalWorkbook
private int
private int
private HSSFPatriarch
private final TreeMap<Integer, HSSFRow>
_rows

stores rows by zero-based row number

private final InternalSheet
_sheet

reference to the low level InternalSheet object

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

Constructor Summary

AccessConstructor 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.

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

index of this region
addMergedRegion
(CellRangeAddress
to merge
region
)

Implements org.apache.poi.ss.usermodel.Sheet.addMergedRegion.

Adds a merged region of cells on a sheet.

private int

Returns:

index of this region
addMergedRegion
(CellRangeAddress
(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 region
addMergedRegionUnsafe
(CellRangeAddress
to merge
region
)

Implements org.apache.poi.ss.usermodel.Sheet.addMergedRegionUnsafe.

Adds a merged region of cells (hence those cells form one).

private void
addRow(HSSFRow row, boolean
whether to add the row to the low level model - false if its already there
addLow
)

add a row to the sheet

public void
addValidationData(DataValidation
The Data validation object settings
dataValidation
)

Implements org.apache.poi.ss.usermodel.Sheet.addValidationData.

Creates a data validation object

public void
autoSizeColumn(int
the column index
column
)

Implements org.apache.poi.ss.usermodel.Sheet.autoSizeColumn.

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.apache.poi.ss.usermodel.Sheet.autoSizeColumn.

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
clip(int
the row number
row
)

bound a row number between 0 and last row index (65535)

pack-priv HSSFSheet
public HSSFPatriarch

Returns:

The new patriarch.
createDrawingPatriarch
()

Implements org.apache.poi.ss.usermodel.Sheet.createDrawingPatriarch.

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.apache.poi.ss.usermodel.Sheet.createFreezePane.

Creates a split (freezepane).

public void
createFreezePane(int
Horizontal position of split.
colSplit
,
int
Vertical position of split.
rowSplit
)

Implements org.apache.poi.ss.usermodel.Sheet.createFreezePane.

Creates a split (freezepane).

public HSSFRow

Returns:

High level HSSFRow object representing a row in the sheet
createRow
(int
row number
rownum
)

Implements org.apache.poi.ss.usermodel.Sheet.createRow.

Create a new row within the sheet and return the high level representation

private HSSFRow

Returns:

HSSFRow high level representation
createRowFromRecord
(RowRecord
low 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.apache.poi.ss.usermodel.Sheet.createSplitPane.

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.apache.poi.ss.usermodel.Sheet.createSplitPane.

Creates a split pane.

private void
deleteOverwrittenHyperlinksForRowShift(int startRow, int endRow, int n)

public void
dumpDrawingRecords(boolean fat, PrintWriter pw)

Aggregates the drawing records and dumps the escher record hierarchy to the standard output.

protected HSSFComment
findCellComment(int row, int column)

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
findFirstRow(int firstrow)

used internally to refresh the "first row" when the first row is removed.

private int
findLastRow(int lastrow)

used internally to refresh the "last row" when the last row is removed.

public CellAddress
getActiveCell()

Implements org.apache.poi.ss.usermodel.Sheet.getActiveCell.

Return location of the active cell, e.g. A1.

public boolean

Returns:

alternative expression evaluation or not
getAlternateExpression
()

whether alternate expression evaluation is on

public boolean

Returns:

alternative formulas or not
getAlternateFormula
()

whether alternative formula entry is on

public boolean

Returns:

whether to show auto page breaks
getAutobreaks
()

Implements org.apache.poi.ss.usermodel.Sheet.getAutobreaks.

show automatic page breaks or not

private NameRecord
getBuiltinNameRecord(byte builtinCode)

public HSSFComment

Returns:

cell comment or null if not found
getCellComment
(CellAddress ref)

Implements org.apache.poi.ss.usermodel.Sheet.getCellComment.

Returns cell comment for the specified row and column

public Map<CellAddress, HSSFComment>

Returns:

A map of each Comment in the sheet, keyed on the cell address where the comment is located.
getCellComments
()

Implements org.apache.poi.ss.usermodel.Sheet.getCellComments.

Returns all cell comments on this sheet.

private CellRange<HSSFCell>
getCellRange(CellRangeAddress range)

Also creates cells if they don't exist

public int[]

Returns:

column indexes of all the vertical page breaks, never null
getColumnBreaks
()

Implements org.apache.poi.ss.usermodel.Sheet.getColumnBreaks.

Retrieves all the vertical page breaks

public int
getColumnOutlineLevel(int columnIndex)

Implements org.apache.poi.ss.usermodel.Sheet.getColumnOutlineLevel.

Returns the column outline level.

public HSSFCellStyle
getColumnStyle(int column)

Implements org.apache.poi.ss.usermodel.Sheet.getColumnStyle.

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
getColumnWidth
(int
- the column to set (0-based)
columnIndex
)

Implements org.apache.poi.ss.usermodel.Sheet.getColumnWidth.

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.apache.poi.ss.usermodel.Sheet.getColumnWidthInPixels.

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<HSSFDataValidation>
getDataValidations()

Implements org.apache.poi.ss.usermodel.Sheet.getDataValidations.

Returns the list of DataValidation in the sheet.

public int

Returns:

default column width
getDefaultColumnWidth
()

Implements org.apache.poi.ss.usermodel.Sheet.getDefaultColumnWidth.

get the default column width for the sheet (if the columns do not define their own width) in characters

public short

Returns:

default row height
getDefaultRowHeight
()

Implements org.apache.poi.ss.usermodel.Sheet.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)

public float

Returns:

default row height in points
getDefaultRowHeightInPoints
()

Implements org.apache.poi.ss.usermodel.Sheet.getDefaultRowHeightInPoints.

get the default row height for the sheet (if the rows do not define their own height) in points.

public boolean

Returns:

isDialog or not
getDialog
()

get whether sheet is a dialog sheet or not

public boolean

Returns:

guts or no guts (or glory)
getDisplayGuts
()

Implements org.apache.poi.ss.usermodel.Sheet.getDisplayGuts.

get whether to display the guts or not

public EscherAggregate
getDrawingEscherAggregate()

Returns the agregate escher records for this sheet, it there is one.

public HSSFPatriarch

Returns:

the top-level drawing patriarch, if there is one, else returns null
getDrawingPatriarch
()

Implements org.apache.poi.ss.usermodel.Sheet.getDrawingPatriarch.

This will hold any graphics or charts for the sheet.

public int

Returns:

the number of the first logical row on the sheet, zero based
getFirstRowNum
()

Implements org.apache.poi.ss.usermodel.Sheet.getFirstRowNum.

Gets the first row on the sheet

public boolean

Returns:

fit or not
getFitToPage
()

Implements org.apache.poi.ss.usermodel.Sheet.getFitToPage.

fit to page option is on

public HSSFFooter
getFooter()

Implements org.apache.poi.ss.usermodel.Sheet.getFooter.

Gets the user model for the default document footer.

public boolean

Returns:

true if an uncalced record must be inserted or not at generation
getForceFormulaRecalculation
()

Implements org.apache.poi.ss.usermodel.Sheet.getForceFormulaRecalculation.

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.apache.poi.ss.usermodel.Sheet.getHeader.

Gets the user model for the default document header.

public boolean
getHorizontallyCenter()

Implements org.apache.poi.ss.usermodel.Sheet.getHorizontallyCenter.

Determine whether printed output for this sheet will be horizontally centered.

public int

Returns:

the number of the last row contained in this sheet, zero based.
getLastRowNum
()

Implements org.apache.poi.ss.usermodel.Sheet.getLastRowNum.

Gets the number last row on the sheet.

public short

Returns:

short indicating the rownum (0 based) of the top row
getLeftCol
()

Implements org.apache.poi.ss.usermodel.Sheet.getLeftCol.

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 margin
getMargin
(short
which margin to get
margin
)

Implements org.apache.poi.ss.usermodel.Sheet.getMargin.

Deprecated use getMargin(PageMargin)

Gets the size of the margin in inches.

public double

Returns:

the size of the margin
getMargin
(PageMargin
which margin to get
margin
)

Implements org.apache.poi.ss.usermodel.Sheet.getMargin.

Gets the size of the margin in inches.

public CellRangeAddress

Returns:

the merged region at the specified index
getMergedRegion
(int index)

Implements org.apache.poi.ss.usermodel.Sheet.getMergedRegion.

Returns the merged region at the specified index

public List<CellRangeAddress>

Returns:

the list of merged regions
getMergedRegions
()

Implements org.apache.poi.ss.usermodel.Sheet.getMergedRegions.

Returns the list of merged regions.

public int

Returns:

number of merged regions
getNumMergedRegions
()

Implements org.apache.poi.ss.usermodel.Sheet.getNumMergedRegions.

returns the number of merged regions

public boolean

Returns:

true => protection enabled; false => protection disabled
getObjectProtect
()

Answer whether object protection is enabled or disabled

public PaneInformation

Returns:

null if no pane configured, or the pane information.
getPaneInformation
()

Implements org.apache.poi.ss.usermodel.Sheet.getPaneInformation.

Returns the information regarding the currently configured pane (split or freeze).

public short

Returns:

hashed password
getPassword
()

private HSSFPatriarch
getPatriarch(boolean createIfMissing)

public int
getPhysicalNumberOfRows()

Implements org.apache.poi.ss.usermodel.Sheet.getPhysicalNumberOfRows.

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.
getPrintSetup
()

Implements org.apache.poi.ss.usermodel.Sheet.getPrintSetup.

Gets the print setup object.

public boolean

Returns:

true => protection enabled; false => protection disabled
getProtect
()

Implements org.apache.poi.ss.usermodel.Sheet.getProtect.

Answer whether protection is enabled or disabled

private WorksheetProtectionBlock
public CellRangeAddress
getRepeatingColumns()

Implements org.apache.poi.ss.usermodel.Sheet.getRepeatingColumns.

Gets the repeating columns used when printing the sheet, as found in File->PageSetup->Sheet.

public CellRangeAddress
getRepeatingRows()

Implements org.apache.poi.ss.usermodel.Sheet.getRepeatingRows.

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 sheet
getRow
(int
row to get
rowIndex
)

Implements org.apache.poi.ss.usermodel.Sheet.getRow.

Returns the logical row (not physical) 0-based.

public int[]

Returns:

row indexes of all the horizontal page breaks, never null
getRowBreaks
()

Implements org.apache.poi.ss.usermodel.Sheet.getRowBreaks.

Retrieves all the horizontal page breaks

public boolean

Returns:

below or not
getRowSumsBelow
()

Implements org.apache.poi.ss.usermodel.Sheet.getRowSumsBelow.

get if row summaries appear below detail in the outline

public boolean

Returns:

right or not
getRowSumsRight
()

Implements org.apache.poi.ss.usermodel.Sheet.getRowSumsRight.

get if col summaries appear right of the detail in the outline

public boolean

Returns:

true => protection enabled; false => protection disabled
getScenarioProtect
()

Implements org.apache.poi.ss.usermodel.Sheet.getScenarioProtect.

Answer whether scenario protection is enabled or disabled

public InternalSheet

Returns:

Sheet - low level representation of this HSSFSheet.
getSheet
()

used internally in the API to get the low level Sheet record represented by this Object.

public HSSFSheetConditionalFormatting
getSheetConditionalFormatting()

Implements org.apache.poi.ss.usermodel.Sheet.getSheetConditionalFormatting.

The 'Conditional Formatting' facet for this Sheet

public String

Returns:

the name of this sheet
getSheetName
()

Implements org.apache.poi.ss.usermodel.Sheet.getSheetName.

Returns the name of this sheet

public short

Returns:

short indicating the rownum (0 based) of the top row
getTopRow
()

Implements org.apache.poi.ss.usermodel.Sheet.getTopRow.

The top row in the visible view when the sheet is first viewed after opening it in a viewer

public boolean
getVerticallyCenter()

Implements org.apache.poi.ss.usermodel.Sheet.getVerticallyCenter.

Determine whether printed output for this sheet will be vertically centered.

public HSSFWorkbook

Returns:

the parent workbook
getWorkbook
()

Implements org.apache.poi.ss.usermodel.Sheet.getWorkbook.

Return the parent workbook

public void
groupColumn(int
beginning of the column range.
fromColumn
,
int
end of the column range.
toColumn
)

Implements org.apache.poi.ss.usermodel.Sheet.groupColumn.

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.apache.poi.ss.usermodel.Sheet.groupRow.

Tie a range of cell together so that they can be collapsed or expanded

protected void
public boolean

Returns:

true if this sheet is currently focused
isActive
()

public boolean

Returns:

FIXME: Document this!
isColumnBroken
(int
FIXME: Document this!
column
)

Implements org.apache.poi.ss.usermodel.Sheet.isColumnBroken.

Determines if there is a page break at the indicated column

public boolean

Returns:

hidden - false if the column is visible
isColumnHidden
(int
- the column to set (0-based)
columnIndex
)

Implements org.apache.poi.ss.usermodel.Sheet.isColumnHidden.

Get the hidden state for a given column.

public boolean

Returns:

whether formulas are displayed
isDisplayFormulas
()

Implements org.apache.poi.ss.usermodel.Sheet.isDisplayFormulas.

Returns if formulas are displayed.

public boolean

Returns:

whether gridlines are displayed
isDisplayGridlines
()

Implements org.apache.poi.ss.usermodel.Sheet.isDisplayGridlines.

Returns if gridlines are displayed.

public boolean

Returns:

whether RowColHeadings are displayed
isDisplayRowColHeadings
()

Implements org.apache.poi.ss.usermodel.Sheet.isDisplayRowColHeadings.

Returns if RowColHeadings are displayed.

public boolean

Returns:

whether all zero values on the worksheet are displayed
isDisplayZeros
()

Implements org.apache.poi.ss.usermodel.Sheet.isDisplayZeros.

Gets the flag indicating whether the window should show 0 (zero) in cells containing zero value.

public boolean

Returns:

true if printed
isGridsPrinted
()

get whether gridlines are printed.

public boolean

Returns:

Gridlines are printed
isPrintGridlines
()

Implements org.apache.poi.ss.usermodel.Sheet.isPrintGridlines.

Returns whether gridlines are printed.

public boolean

Returns:

row and column headings are printed
isPrintRowAndColumnHeadings
()

Implements org.apache.poi.ss.usermodel.Sheet.isPrintRowAndColumnHeadings.

Returns whether row and column headings are printed.

public boolean

Returns:

whether the text is displayed in right-to-left mode in the window
isRightToLeft
()

Implements org.apache.poi.ss.usermodel.Sheet.isRightToLeft.

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 row
isRowBroken
(int
FIXME: Document this!
row
)

Implements org.apache.poi.ss.usermodel.Sheet.isRowBroken.

Determines if there is a page break at the indicated row

public boolean

Returns:

true if this sheet is currently selected
isSelected
()

Implements org.apache.poi.ss.usermodel.Sheet.isSelected.

Note - this is not the same as whether the sheet is focused (isActive)

private HSSFComment
lookForComment(HSSFShapeContainer container, int row, int column)

private void
moveCommentsForRowShift(int startRow, int endRow, int n)

private void
protected void
preSerialize()

check whether the data of sheet can be serialized

public void
protectSheet(String
to set for protection. Pass null to remove protection
password
)

Implements org.apache.poi.ss.usermodel.Sheet.protectSheet.

Sets the protection enabled as well as the password

private void
recomputeFirstAndLastRowsForRowShift(int startRow, int endRow, int n)

public CellRange<HSSFCell>
removeArrayFormula(Cell
any cell within Array Formula range
cell
)

Implements org.apache.poi.ss.usermodel.Sheet.removeArrayFormula.

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.apache.poi.ss.usermodel.Sheet.removeColumnBreak.

Removes a page break at the indicated column

public void
removeMergedRegion(int
of the region to unmerge
index
)

Implements org.apache.poi.ss.usermodel.Sheet.removeMergedRegion.

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.apache.poi.ss.usermodel.Sheet.removeMergedRegions.

Removes a number of merged regions of cells (hence letting them free)

public void
removeRow(Row
representing a row to remove.
row
)

Implements org.apache.poi.ss.usermodel.Sheet.removeRow.

Remove a row from this sheet.

public void
removeRowBreak(int
The 0-based index of the row.
row
)

Implements org.apache.poi.ss.usermodel.Sheet.removeRowBreak.

Removes the page break at the indicated row

public Iterator<Row>

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.
rowIterator
()

Implements org.apache.poi.ss.usermodel.Sheet.rowIterator.

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. A1.
address
)

Implements org.apache.poi.ss.usermodel.Sheet.setActiveCell.

Sets location of the active cell

public void
setAlternativeExpression(boolean
alternative expression evaluation or not
b
)

whether alternate expression evaluation is on

public void
setAlternativeFormula(boolean
alternative formulas or not
b
)

whether alternative formula entry is on

public CellRange<HSSFCell>
setArrayFormula(String
text representation of the formula
formula
,
CellRangeAddress
Region of array formula for result.
range
)

Implements org.apache.poi.ss.usermodel.Sheet.setArrayFormula.

Sets array formula to specified region for result.

public void
setAutobreaks(boolean
whether to show auto page breaks
b
)

Implements org.apache.poi.ss.usermodel.Sheet.setAutobreaks.

show automatic page breaks or not

public HSSFAutoFilter
setAutoFilter(CellRangeAddress
the range of cells to filter
range
)

Implements org.apache.poi.ss.usermodel.Sheet.setAutoFilter.

Enable filtering for a range of cells

public void
setColumnBreak(int
the column to break, inclusive
column
)

Implements org.apache.poi.ss.usermodel.Sheet.setColumnBreak.

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.apache.poi.ss.usermodel.Sheet.setColumnGroupCollapsed.

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.apache.poi.ss.usermodel.Sheet.setColumnHidden.

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.apache.poi.ss.usermodel.Sheet.setColumnWidth.

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.apache.poi.ss.usermodel.Sheet.setDefaultColumnStyle.

Sets the default column style for a given column.

public void
setDefaultColumnWidth(int
default column width
width
)

Implements org.apache.poi.ss.usermodel.Sheet.setDefaultColumnWidth.

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.apache.poi.ss.usermodel.Sheet.setDefaultRowHeight.

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.apache.poi.ss.usermodel.Sheet.setDefaultRowHeightInPoints.

set the default row height for the sheet (if the rows do not define their own height) in points

public void
setDialog(boolean
isDialog or not
b
)

set whether sheet is a dialog sheet or not

public void
setDisplayFormulas(boolean
whether to show formulas or not
show
)

Implements org.apache.poi.ss.usermodel.Sheet.setDisplayFormulas.

Sets whether the formulas are shown in a viewer.

public void
setDisplayGridlines(boolean
whether to show gridlines or not
show
)

Implements org.apache.poi.ss.usermodel.Sheet.setDisplayGridlines.

Sets whether the gridlines are shown in a viewer.

public void
setDisplayGuts(boolean
guts or no guts (or glory)
b
)

Implements org.apache.poi.ss.usermodel.Sheet.setDisplayGuts.

set whether to display the guts or not

public void
setDisplayRowColHeadings(boolean
whether to show RowColHeadings or not
show
)

Implements org.apache.poi.ss.usermodel.Sheet.setDisplayRowColHeadings.

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.apache.poi.ss.usermodel.Sheet.setDisplayZeros.

Set whether the window should show 0 (zero) in cells containing zero value.

public void
setFitToPage(boolean
fit or not
b
)

Implements org.apache.poi.ss.usermodel.Sheet.setFitToPage.

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.apache.poi.ss.usermodel.Sheet.setForceFormulaRecalculation.

Control if Excel should be asked to recalculate all formulas on this sheet when the workbook is opened.

public void
setGridsPrinted(boolean
false if not printed.
value
)

set whether gridlines printed.

public void
setHorizontallyCenter(boolean
true to horizontally center, false otherwise.
value
)

Implements org.apache.poi.ss.usermodel.Sheet.setHorizontallyCenter.

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.apache.poi.ss.usermodel.Sheet.setMargin.

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.apache.poi.ss.usermodel.Sheet.setMargin.

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.apache.poi.ss.usermodel.Sheet.setPrintGridlines.

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.apache.poi.ss.usermodel.Sheet.setPrintRowAndColumnHeadings.

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 CellRangeAddress containing the repeating columns for the Sheet, or null.
columnRangeRef
)

Implements org.apache.poi.ss.usermodel.Sheet.setRepeatingColumns.

Sets the repeating columns used when printing the sheet, as found in File->PageSetup->Sheet.

public void
setRepeatingRows(CellRangeAddress
a CellRangeAddress containing the repeating rows for the Sheet, or null.
rowRangeRef
)

Implements org.apache.poi.ss.usermodel.Sheet.setRepeatingRows.

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.apache.poi.ss.usermodel.Sheet.setRightToLeft.

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.apache.poi.ss.usermodel.Sheet.setRowBreak.

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.apache.poi.ss.usermodel.Sheet.setRowGroupCollapsed.

Set view state of a grouped range of rows

public void
setRowSumsBelow(boolean
below or not
b
)

Implements org.apache.poi.ss.usermodel.Sheet.setRowSumsBelow.

set if row summaries appear below detail in the outline

public void
setRowSumsRight(boolean
right or not
b
)

Implements org.apache.poi.ss.usermodel.Sheet.setRowSumsRight.

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.apache.poi.ss.usermodel.Sheet.setSelected.

Sets whether sheet is selected.

public void
setVerticallyCenter(boolean
true to vertically center, false otherwise.
value
)

Implements org.apache.poi.ss.usermodel.Sheet.setVerticallyCenter.

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.apache.poi.ss.usermodel.Sheet.setZoom.

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.apache.poi.ss.usermodel.Sheet.shiftColumns.

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.apache.poi.ss.usermodel.Sheet.shiftRows.

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.apache.poi.ss.usermodel.Sheet.shiftRows.

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.apache.poi.ss.usermodel.Sheet.showInPane.

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<Row>

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.
spliterator
()

Overrides default org.apache.poi.ss.usermodel.Sheet.spliterator.

Returns a spliterator of the physical rows

public void
ungroupColumn(int
start column (0-based)
fromColumn
,
int
end column (0-based)
toColumn
)

Implements org.apache.poi.ss.usermodel.Sheet.ungroupColumn.

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.apache.poi.ss.usermodel.Sheet.ungroupRow.

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.apache.poi.ss.usermodel.Sheet.validateMergedRegions.

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
validateRow(int
the index of the row to validate, zero-based
row
)

Runs a bounds check for row numbers

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait