/** * @since 3.15 beta 2 */ public int getEndRowIndex() { return getEndCellReference().getRow(); }
/** * @since 3.15 beta 2 */ public int getEndColIndex() { return getEndCellReference().getCol(); }
/** * Get the area reference for the cells which this table covers. The area * includes header rows and totals rows. * * Does not track updates to underlying changes to CTTable To synchronize * with changes to the underlying CTTable, call {@link #updateReferences()}. * * @return the area of the table * @see "Open Office XML Part 4: chapter 3.5.1.2, attribute ref" * @since 3.17 beta 1 */ public AreaReference getCellReferences() { return new AreaReference( getStartCellReference(), getEndCellReference(), SpreadsheetVersion.EXCEL2007 ); }
/** * Get the total number of rows in this table, including all * {@linkplain #getHeaderRowCount() header rows} and all * {@linkplain #getTotalsRowCount() totals rows}. (Note: in this version * autofiltering is ignored) * * Returns <code>0</code> if the start or end cell references are not set. * * Does not track updates to underlying changes to CTTable To synchronize * with changes to the underlying CTTable, call {@link #updateReferences()}. * * @return the total number of rows */ public int getRowCount() { CellReference from = getStartCellReference(); CellReference to = getEndCellReference(); int rowCount = 0; if (from!=null && to!=null) { rowCount = to.getRow() - from.getRow() + 1; } return rowCount; }
int endRow = table.getEndCellReference().getRow();
/** * Get the number of data rows in this table. This does not include any * header rows or totals rows. * * Returns <code>0</code> if the start or end cell references are not set. * * Does not track updates to underlying changes to CTTable To synchronize * with changes to the underlying CTTable, call {@link #updateReferences()}. * * @return the number of data rows * @since 4.0.0 */ public int getDataRowCount() { CellReference from = getStartCellReference(); CellReference to = getEndCellReference(); int rowCount = 0; if (from != null && to != null) { rowCount = (to.getRow() - from.getRow() + 1) - getHeaderRowCount() - getTotalsRowCount(); } return rowCount; }
return new AreaReference(table.getStartCellReference(), table.getEndCellReference(), SpreadsheetVersion.EXCEL2007);
CellReference tableEnd = getEndCellReference(); SpreadsheetVersion version = getXSSFSheet().getWorkbook().getSpreadsheetVersion(); CellReference newTableEnd = new CellReference(tableEnd.getRow(),
CellReference tableEnd = getEndCellReference(); SpreadsheetVersion version = getXSSFSheet().getWorkbook().getSpreadsheetVersion();
/** * @since 3.15 beta 2 */ public int getEndColIndex() { return getEndCellReference().getCol(); }
/** * @since 3.15 beta 2 */ public int getEndRowIndex() { return getEndCellReference().getRow(); }
/** * Get the area reference for the cells which this table covers. The area * includes header rows and totals rows. * * Does not track updates to underlying changes to CTTable To synchronize * with changes to the underlying CTTable, call {@link #updateReferences()}. * * @return the area of the table * @see "Open Office XML Part 4: chapter 3.5.1.2, attribute ref" * @since 3.17 beta 1 */ public AreaReference getCellReferences() { return new AreaReference( getStartCellReference(), getEndCellReference(), SpreadsheetVersion.EXCEL2007 ); }
/** * @return the total number of rows in the selection. (Note: in this version autofiltering is ignored) * */ public int getRowCount(){ CellReference from = getStartCellReference(); CellReference to = getEndCellReference(); int rowCount = -1; if (from!=null && to!=null){ rowCount = to.getRow()-from.getRow(); } return rowCount; } }
int endRow = t.getEndCellReference().getRow(); System.out.println("startRow = " + startRow); System.out.println("endRow = " + endRow); int endColumn = t.getEndCellReference().getCol();
/** * Get the total number of rows in this table, including all * {@linkplain #getHeaderRowCount() header rows} and all * {@linkplain #getTotalsRowCount() totals rows}. (Note: in this version * autofiltering is ignored) * * Returns <code>0</code> if the start or end cell references are not set. * * Does not track updates to underlying changes to CTTable To synchronize * with changes to the underlying CTTable, call {@link #updateReferences()}. * * @return the total number of rows */ public int getRowCount() { CellReference from = getStartCellReference(); CellReference to = getEndCellReference(); int rowCount = 0; if (from!=null && to!=null) { rowCount = to.getRow() - from.getRow() + 1; } return rowCount; }
/** * Get the number of data rows in this table. This does not include any * header rows or totals rows. * * Returns <code>0</code> if the start or end cell references are not set. * * Does not track updates to underlying changes to CTTable To synchronize * with changes to the underlying CTTable, call {@link #updateReferences()}. * * @return the number of data rows * @since 4.0.0 */ public int getDataRowCount() { CellReference from = getStartCellReference(); CellReference to = getEndCellReference(); int rowCount = 0; if (from != null && to != null) { rowCount = (to.getRow() - from.getRow() + 1) - getHeaderRowCount() - getTotalsRowCount(); } return rowCount; }
int endRow = table.getEndCellReference().getRow(); for(int j = startColumnIndex; j<= table.getEndCellReference().getCol();j++) { XSSFCell cell = row.getCell(j); if (cell!=null) {
return new AreaReference(table.getStartCellReference(), table.getEndCellReference(), SpreadsheetVersion.EXCEL2007);
CellReference tableEnd = getEndCellReference(); SpreadsheetVersion version = getXSSFSheet().getWorkbook().getSpreadsheetVersion(); CellReference newTableEnd = new CellReference(tableEnd.getRow(),
CellReference tableEnd = getEndCellReference(); SpreadsheetVersion version = getXSSFSheet().getWorkbook().getSpreadsheetVersion();