Java org.apache.poi.hssf.usermodel HSSFSheet fields, constructors, methods, implement or subclass

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

Introduction

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

The text is from its open source code.

Method

intaddMergedRegion(CellRangeAddress region)
Adds a merged region of cells on a sheet.
voidaddValidationData(DataValidation dataValidation)
Creates a data validation object
voidautoSizeColumn(int column)
Adjusts the column width to fit the contents.

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.

voidautoSizeColumn(int column, boolean useMergedCells)
Adjusts the column width to fit the contents.

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.

HSSFPatriarchcreateDrawingPatriarch()
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).
HSSFRowcreateRow(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.
booleangetAlternateExpression()
whether alternate expression evaluation is on
booleangetAlternateFormula()
whether alternative formula entry is on
booleangetAutobreaks()
show automatic page breaks or not
int[]getColumnBreaks()
intgetColumnWidth(int columnIndex)
get the width (in units of 1/256th of a character width )
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.
booleangetDialog()
get whether sheet is a dialog sheet or not
booleangetDisplayGuts()
get whether to display the guts or not
EscherAggregategetDrawingEscherAggregate()
Returns the agregate escher records for this sheet, it there is one.
HSSFPatriarchgetDrawingPatriarch()
This will hold any graphics or charts for the sheet.
intgetFirstRowNum()
Gets the first row on the sheet
booleangetFitToPage()
fit to page option is on
HSSFFootergetFooter()
HSSFHeadergetHeader()
booleangetHorizontallyCenter()
Determine whether printed output for this sheet will be horizontally centered.
intgetLastRowNum()
Gets the number last row on the sheet.
doublegetMargin(short margin)
Gets the size of the margin in inches.
CellRangeAddressgetMergedRegion(int index)
intgetNumMergedRegions()
returns the number of merged regions
intgetPhysicalNumberOfRows()
Returns the number of physically defined rows (NOT the number of rows in the sheet)
HSSFPrintSetupgetPrintSetup()
Gets the print setup object.
HSSFRowgetRow(int rowIndex)
Returns the logical row (not physical) 0-based.
int[]getRowBreaks()
booleangetRowSumsBelow()
get if row summaries appear below detail in the outline
booleangetRowSumsRight()
get if col summaries appear right of the detail in the outline
HSSFSheetConditionalFormattinggetSheetConditionalFormatting()
StringgetSheetName()
Returns the name of this sheet
HSSFWorkbookgetWorkbook()
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 cell 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.
booleanisGridsPrinted()
get whether gridlines are printed.
booleanisPrintGridlines()
Returns whether gridlines are printed.
Iteratoriterator()
Alias for #rowIterator() to allow foreach loops
voidprotectSheet(String password)
Sets the protection enabled as well as the password
voidremoveMergedRegion(int index)
removes a merged region of cells (hence letting them free)
voidremoveRow(Row row)
Remove a row from this sheet.
IteratorrowIterator()
voidsetActive(boolean sel)
Sets whether sheet is selected.
voidsetAlternativeExpression(boolean b)
whether alternate expression evaluation is on
voidsetAlternativeFormula(boolean b)
whether alternative formula entry is on
voidsetAutobreaks(boolean b)
show automatic page breaks or not
HSSFAutoFiltersetAutoFilter(CellRangeAddress range)
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
voidsetDialog(boolean b)
set whether sheet is a dialog sheet or not
voidsetDisplayFormulas(boolean show)
Sets whether the formulas are shown in a viewer.
voidsetDisplayGridlines(boolean show)
Sets whether the gridlines are shown in a viewer.
voidsetDisplayGuts(boolean b)
set whether to display the guts or not
voidsetDisplayRowColHeadings(boolean show)
Sets whether the RowColHeadings are shown in a viewer.
voidsetFitToPage(boolean b)
fit to page option is on
voidsetForceFormulaRecalculation(boolean value)
Control if Excel should be asked to recalculate all formulas on this sheet when the workbook is opened.

Calculating the formula values with org.apache.poi.ss.usermodel.FormulaEvaluator is the recommended solution, but this may be used for certain cases where evaluation in POI is not possible.

It is recommended to force recalcuation of formulas on workbook level using org.apache.poi.ss.usermodel.Workbook#setForceFormulaRecalculation(boolean) to ensure that all cross-worksheet formuals and external dependencies are updated.

voidsetGridsPrinted(boolean value)
set whether gridlines printed.
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)
Turns on or off the printing of gridlines.
voidsetRepeatingRows(CellRangeAddress rowRangeRef)
voidsetRowBreak(int row)
Sets a page break at the indicated row Breaks occur above the specified row and left of the specified column inclusive.

For example, sheet.setColumnBreak(2); breaks the sheet into two parts with columns A,B,C in the first and D,E,...

voidsetRowGroupCollapsed(int rowIndex, boolean collapse)
voidsetRowSumsBelow(boolean b)
set if row summaries appear below detail in the outline
voidsetRowSumsRight(boolean b)
set if col summaries appear right of the detail in the outline
voidsetSelected(boolean sel)
Sets whether sheet is selected.
voidsetVerticallyCenter(boolean value)
determines whether the output is vertically centered on the page.
voidsetZoom(int numerator, int denominator)
Sets the zoom magnification for the sheet.
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.