Example usage for Java org.apache.poi.ss.usermodel Sheet fields, constructors, methods, implement or subclass
The text is from its open source code.
short | LeftMargin |
short | RightMargin |
short | TopMargin |
short | BottomMargin |
short | HeaderMargin |
short | FooterMargin |
byte | PANE_LOWER_RIGHT |
byte | PANE_UPPER_RIGHT |
byte | PANE_LOWER_LEFT |
int | addMergedRegion(CellRangeAddress region) Adds a merged region of cells (hence those cells form one) |
void | addValidationData(DataValidation dataValidation) Creates a data validation object |
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. |
Drawing> | createDrawingPatriarch() Creates the top-level drawing patriarch. |
void | createFreezePane(int colSplit, int rowSplit) Creates a split (freezepane). |
void | createFreezePane(int colSplit, int rowSplit, int leftmostColumn, int topRow) Creates a split (freezepane). |
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. |
Map | getCellComments() Returns all cell comments on this sheet. |
int[] | getColumnBreaks() Retrieves all the vertical page breaks |
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 width (in units of 1/256th of a character width ) Character width is defined as the maximum digit width of the numbers |
float | getColumnWidthInPixels(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). |
DataValidationHelper | getDataValidationHelper() |
List extends DataValidation> | getDataValidations() Returns the list of DataValidation in the sheet. |
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 (if the rows do not define their own height) in points. |
int | getFirstRowNum() Gets the first row on the sheet. |
boolean | getFitToPage() Flag indicating whether the Fit to Page print option is enabled. |
Footer | getFooter() Gets the user model for the default document footer. Note that XSSF offers more kinds of document footers than HSSF does. |
boolean | getForceFormulaRecalculation() Whether Excel will be asked to recalculate all formulas in this sheet when the workbook is opened. |
Header | getHeader() Gets the user model for the default document header. Note that XSSF offers more kinds of document headers than HSSF does |
int | getLastRowNum() 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! |
short | getLeftCol() The left col in the visible view when the sheet is first viewed after opening it in a viewer |
CellRangeAddress | getMergedRegion(int index) Returns the merged region at the specified index |
List | getMergedRegions() Returns the list of merged regions. |
int | getNumMergedRegions() Returns the number of merged regions |
PaneInformation | getPaneInformation() Returns the information regarding the currently configured pane (split or freeze) |
int | getPhysicalNumberOfRows() Returns the number of physically defined rows (NOT the number of rows in the sheet) |
PrintSetup | getPrintSetup() Gets the print setup object. |
boolean | getProtect() Answer whether protection is enabled or disabled |
CellRangeAddress | getRepeatingColumns() 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:$FThe 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. |
CellRangeAddress | getRepeatingRows() 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:$8The 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. |
Row | getRow(int rownum) Returns the logical row (not physical) 0-based. |
int[] | getRowBreaks() Retrieves all the horizontal page breaks |
SheetConditionalFormatting | getSheetConditionalFormatting() The 'Conditional Formatting' facet for this Sheet |
String | getSheetName() Returns the name of this sheet |
Workbook | getWorkbook() Return the parent workbook |
void | groupColumn(int fromColumn, int toColumn) Create an outline for the provided column range. |
void | groupRow(int fromRow, int toRow) Tie a range of rows together so that they can be collapsed or expanded |
boolean | isColumnHidden(int columnIndex) Get the hidden state for a given column |
boolean | isDisplayFormulas() Returns if formulas are displayed |
boolean | isDisplayGridlines() Returns if gridlines are displayed |
boolean | isDisplayRowColHeadings() Returns if RowColHeadings are displayed. |
boolean | isDisplayZeros() Gets the flag indicating whether the window should show 0 (zero) in cells containing zero value. |
void | protectSheet(String password) Sets the protection enabled as well as the password |
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(Row row) Remove a row from this sheet. |
void | removeRowBreak(int row) Removes the page break at the indicated row |
Iterator | rowIterator() Returns an iterator of the physical rows |
void | setAutobreaks(boolean value) Flag indicating whether the sheet displays Automatic Page Breaks. |
AutoFilter | setAutoFilter(CellRangeAddress range) Enable filtering for a range of cells |
void | setColumnBreak(int column) Sets a page break at the indicated column. |
void | setColumnGroupCollapsed(int columnNumber, boolean collapsed) Expands or collapses a column group. |
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) The maximum column width for an individual cell is 255 characters. |
void | setDefaultColumnStyle(int column, CellStyle style) Sets the default column style for a given column. |
void | setDefaultColumnWidth(int width) Set the default column width for the sheet (if the columns do not define their own width) in characters |
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) Set the default row height for the sheet (if the rows do not define their own height) in points |
void | setDisplayGridlines(boolean show) Sets whether the gridlines are shown in a viewer |
void | setDisplayRowColHeadings(boolean show) Sets whether the RowColHeadings are shown in a viewer |
void | setFitToPage(boolean value) Flag indicating whether the Fit to Page print option is enabled. |
void | setForceFormulaRecalculation(boolean value) Control if Excel should be asked to recalculate all formulas on this sheet when the workbook is opened. |
void | setHorizontallyCenter(boolean value) Determines whether the output is horizontally centered on the page. |
void | setMargin(short margin, double size) Sets the size of the margin in inches. |
void | setPrintGridlines(boolean show) Sets the flag indicating whether this sheet should print the lines between rows and columns to make editing and reading easier. |
void | setRepeatingColumns(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:$FThe 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); |
void | setRepeatingRows(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:$8The 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); |
void | setRowBreak(int row) Sets a page break at the indicated row Breaks occur above the specified row and left of the specified column inclusive. |
void | setRowGroupCollapsed(int row, boolean collapse) Set view state of a grouped range of rows |
void | setSelected(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. |
void | setZoom(int scale) Window zoom magnification for current view representing percent values. |
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(int toprow, int leftcol) Sets desktop window pane display area, when the file is first opened in a viewer. |