Java org.apache.poi.ss.usermodel Sheet fields, constructors, methods, implement or subclass

Example usage for Java org.apache.poi.ss.usermodel Sheet fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for org.apache.poi.ss.usermodel Sheet.

The text is from its open source code.

Implementation

org.apache.poi.ss.usermodel.Sheet has the following implementations.
Click this link to see all its implementation.

Field

Method

intaddMergedRegion(CellRangeAddress region)
Adds a merged region of cells (hence those cells form one)
voidaddValidationData(DataValidation dataValidation)
Creates a data validation object
voidautoSizeColumn(int column)
Adjusts the column width to fit the contents.
voidautoSizeColumn(int column, boolean useMergedCells)
Adjusts the column width to fit the contents.
DrawingcreateDrawingPatriarch()
Creates the top-level drawing patriarch.
voidcreateFreezePane(int colSplit, int rowSplit)
Creates a split (freezepane).
voidcreateFreezePane(int colSplit, int rowSplit, int leftmostColumn, int topRow)
Creates a split (freezepane).
RowcreateRow(int rownum)
Create a new row within the sheet and return the high level representation
voidcreateSplitPane(int xSplitPos, int ySplitPos, int leftmostColumn, int topRow, int activePane)
Creates a split pane.
MapgetCellComments()
Returns all cell comments on this sheet.
int[]getColumnBreaks()
Retrieves all the vertical page breaks
CellStylegetColumnStyle(int column)
Returns the CellStyle that applies to the given (0 based) column, or null if no style has been set for that column
intgetColumnWidth(int columnIndex)
get the width (in units of 1/256th of a character width )

Character width is defined as the maximum digit width of the numbers 0, 1, 2, ...

floatgetColumnWidthInPixels(int columnIndex)
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).

DataValidationHelpergetDataValidationHelper()
ListgetDataValidations()
Returns the list of DataValidation in the sheet.
intgetDefaultColumnWidth()
Get the default column width for the sheet (if the columns do not define their own width) in characters
shortgetDefaultRowHeight()
Get the default row height for the sheet (if the rows do not define their own height) in twips (1/20 of a point)
floatgetDefaultRowHeightInPoints()
Get the default row height for the sheet (if the rows do not define their own height) in points.
intgetFirstRowNum()
Gets the first row on the sheet.
booleangetFitToPage()
Flag indicating whether the Fit to Page print option is enabled.
FootergetFooter()
Gets the user model for the default document footer.

Note that XSSF offers more kinds of document footers than HSSF does.

booleangetForceFormulaRecalculation()
Whether Excel will be asked to recalculate all formulas in this sheet when the workbook is opened.
HeadergetHeader()
Gets the user model for the default document header.

Note that XSSF offers more kinds of document headers than HSSF does

intgetLastRowNum()
Gets the last row on the sheet Note: rows which had content before and were set to empty later might still be counted as rows by Excel and Apache POI, so the result of this method will include such rows and thus the returned value might be higher than expected!
shortgetLeftCol()
The left col in the visible view when the sheet is first viewed after opening it in a viewer
CellRangeAddressgetMergedRegion(int index)
Returns the merged region at the specified index
ListgetMergedRegions()
Returns the list of merged regions.
intgetNumMergedRegions()
Returns the number of merged regions
PaneInformationgetPaneInformation()
Returns the information regarding the currently configured pane (split or freeze)
intgetPhysicalNumberOfRows()
Returns the number of physically defined rows (NOT the number of rows in the sheet)
PrintSetupgetPrintSetup()
Gets the print setup object.
booleangetProtect()
Answer whether protection is enabled or disabled
CellRangeAddressgetRepeatingColumns()
Gets the repeating columns used when printing the sheet, as found in File->PageSetup->Sheet.

Repeating columns cover a range of contiguous columns, e.g.:

 Sheet1!$A:$A Sheet2!$C:$F 
The CellRangeAddress returned contains a row part which spans all rows, and a column part which specifies the contiguous range of repeating columns.

If the Sheet does not have any repeating columns defined, null is returned.

CellRangeAddressgetRepeatingRows()
Gets the repeating rows used when printing the sheet, as found in File->PageSetup->Sheet.

Repeating rows cover a range of contiguous rows, e.g.:

 Sheet1!$1:$1 Sheet2!$5:$8 
The CellRangeAddress returned contains a column part which spans all columns, and a row part which specifies the contiguous range of repeating rows.

If the Sheet does not have any repeating rows defined, null is returned.

RowgetRow(int rownum)
Returns the logical row (not physical) 0-based.
int[]getRowBreaks()
Retrieves all the horizontal page breaks
SheetConditionalFormattinggetSheetConditionalFormatting()
The 'Conditional Formatting' facet for this Sheet
StringgetSheetName()
Returns the name of this sheet
WorkbookgetWorkbook()
Return the parent workbook
voidgroupColumn(int fromColumn, int toColumn)
Create an outline for the provided column range.
voidgroupRow(int fromRow, int toRow)
Tie a range of rows together so that they can be collapsed or expanded
booleanisColumnHidden(int columnIndex)
Get the hidden state for a given column
booleanisDisplayFormulas()
Returns if formulas are displayed
booleanisDisplayGridlines()
Returns if gridlines are displayed
booleanisDisplayRowColHeadings()
Returns if RowColHeadings are displayed.
booleanisDisplayZeros()
Gets the flag indicating whether the window should show 0 (zero) in cells containing zero value.
voidprotectSheet(String password)
Sets the protection enabled as well as the password
voidremoveColumnBreak(int column)
Removes a page break at the indicated column
voidremoveMergedRegion(int index)
Removes a merged region of cells (hence letting them free)
voidremoveRow(Row row)
Remove a row from this sheet.
voidremoveRowBreak(int row)
Removes the page break at the indicated row
IteratorrowIterator()
Returns an iterator of the physical rows
voidsetAutobreaks(boolean value)
Flag indicating whether the sheet displays Automatic Page Breaks.
AutoFiltersetAutoFilter(CellRangeAddress range)
Enable filtering for a range of cells
voidsetColumnBreak(int column)
Sets a page break at the indicated column.
voidsetColumnGroupCollapsed(int columnNumber, boolean collapsed)
Expands or collapses a column group.
voidsetColumnHidden(int columnIndex, boolean hidden)
Get the visibility state for a given column
voidsetColumnWidth(int columnIndex, int width)
Set the width (in units of 1/256th of a character width)

The maximum column width for an individual cell is 255 characters.

voidsetDefaultColumnStyle(int column, CellStyle style)
Sets the default column style for a given column.
voidsetDefaultColumnWidth(int width)
Set the default column width for the sheet (if the columns do not define their own width) in characters
voidsetDefaultRowHeight(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)
voidsetDefaultRowHeightInPoints(float height)
Set the default row height for the sheet (if the rows do not define their own height) in points
voidsetDisplayGridlines(boolean show)
Sets whether the gridlines are shown in a viewer
voidsetDisplayRowColHeadings(boolean show)
Sets whether the RowColHeadings are shown in a viewer
voidsetFitToPage(boolean value)
Flag indicating whether the Fit to Page print option is enabled.
voidsetForceFormulaRecalculation(boolean value)
Control if Excel should be asked to recalculate all formulas on this sheet when the workbook is opened.
voidsetHorizontallyCenter(boolean value)
Determines whether the output is horizontally centered on the page.
voidsetMargin(short margin, double size)
Sets the size of the margin in inches.
voidsetPrintGridlines(boolean show)
Sets the flag indicating whether this sheet should print the lines between rows and columns to make editing and reading easier.
voidsetRepeatingColumns(CellRangeAddress columnRangeRef)
Sets the repeating columns used when printing the sheet, as found in File->PageSetup->Sheet.

Repeating columns cover a range of contiguous columns, e.g.:

 Sheet1!$A:$A Sheet2!$C:$F
The parameter CellRangeAddress should specify a row part which spans all rows, and a column part which specifies the contiguous range of repeating columns, e.g.:
 sheet.setRepeatingColumns(CellRangeAddress.valueOf("B:C"));
A null parameter value indicates that repeating columns should be removed from the Sheet:
 sheet.setRepeatingColumns(null);
voidsetRepeatingRows(CellRangeAddress rowRangeRef)
Sets the repeating rows used when printing the sheet, as found in File->PageSetup->Sheet.

Repeating rows cover a range of contiguous rows, e.g.:

 Sheet1!$1:$1 Sheet2!$5:$8
The parameter CellRangeAddress should specify a column part which spans all columns, and a row part which specifies the contiguous range of repeating rows, e.g.:
 sheet.setRepeatingRows(CellRangeAddress.valueOf("2:3"));
A null parameter value indicates that repeating rows should be removed from the Sheet:
 sheet.setRepeatingRows(null);
voidsetRowBreak(int row)
Sets a page break at the indicated row Breaks occur above the specified row and left of the specified column inclusive.
voidsetRowGroupCollapsed(int row, boolean collapse)
Set view state of a grouped range of rows
voidsetSelected(boolean value)
Sets a flag indicating whether this sheet is selected.

Note: multiple sheets can be selected, but only one sheet can be active at one time.

voidsetZoom(int scale)
Window zoom magnification for current view representing percent values.
voidshiftRows(int startRow, int endRow, int n)
Shifts rows between startRow and endRow n number of rows.
voidshiftRows(int startRow, int endRow, int n, boolean copyRowHeight, boolean resetOriginalRowHeight)
Shifts rows between startRow and endRow n number of rows.
voidshowInPane(int toprow, int leftcol)
Sets desktop window pane display area, when the file is first opened in a viewer.