/** * @since 3.15 beta 2 */ public int getStartColIndex() { return getStartCellReference().getCol(); }
/** * @since 3.15 beta 2 */ public int getStartRowIndex() { return getStartCellReference().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 ); }
/** * 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 startRow = table.getStartCellReference().getRow() + table.getHeaderRowCount(); int endRow = table.getEndCellReference().getRow(); short startColumnIndex = table.getStartCellReference().getCol(); for (XSSFTableColumn tableColumn : tableColumns) { XSSFCell cell = row.getCell(startColumnIndex + tableColumn.getColumnIndex());
/** * 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 rowOffset = table.getStartCellReference().getRow() + table.getHeaderRowCount(); int columnOffset = table.getStartCellReference().getCol();
return new AreaReference(table.getStartCellReference(), table.getEndCellReference(), SpreadsheetVersion.EXCEL2007);
CellReference tableStart = getStartCellReference(); CellReference tableEnd = getEndCellReference(); SpreadsheetVersion version = getXSSFSheet().getWorkbook().getSpreadsheetVersion();
CellReference ref = getStartCellReference(); if (ref == null) return;
CellReference tableStart = getStartCellReference(); CellReference tableEnd = getEndCellReference(); SpreadsheetVersion version = getXSSFSheet().getWorkbook().getSpreadsheetVersion();
/** * @since 3.15 beta 2 */ public int getStartColIndex() { return getStartCellReference().getCol(); }
/** * @since 3.15 beta 2 */ public int getStartRowIndex() { return getStartCellReference().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; } }
System.out.println(t.getNumerOfMappedColumns()); int startRow = t.getStartCellReference().getRow(); int endRow = t.getEndCellReference().getRow(); System.out.println("startRow = " + startRow); System.out.println("endRow = " + endRow); int startColumn = t.getStartCellReference().getCol(); 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; }
return new AreaReference(table.getStartCellReference(), table.getEndCellReference(), SpreadsheetVersion.EXCEL2007);
CellReference ref = getStartCellReference(); if (ref == null) return;