/** * 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 minimumRowCount = 1 + getHeaderRowCount() + getTotalsRowCount(); if (rowCount < minimumRowCount) { throw new IllegalArgumentException("AreaReference needs at least " + minimumRowCount
if (ctTable.isSetAutoFilter()) { String filterRef; int totalsRowCount = getTotalsRowCount(); if (totalsRowCount == 0) { filterRef = ref;
int newTotalRowCount = getHeaderRowCount() + newDataRowCount + getTotalsRowCount(); CellReference newTableEnd = new CellReference(tableStart.getRow() + newTotalRowCount - 1, tableEnd.getCol());
/** * 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 minimumRowCount = 1 + getHeaderRowCount() + getTotalsRowCount(); if (rowCount < minimumRowCount) { throw new IllegalArgumentException("AreaReference needs at least " + minimumRowCount
if (ctTable.isSetAutoFilter()) { String filterRef; int totalsRowCount = getTotalsRowCount(); if (totalsRowCount == 0) { filterRef = ref;
int newTotalRowCount = getHeaderRowCount() + newDataRowCount + getTotalsRowCount(); CellReference newTableEnd = new CellReference(tableStart.getRow() + newTotalRowCount - 1, tableEnd.getCol());