/** * Returns the data table with the given name (case insensitive). * * @param name the data table name (case-insensitive) * @return The Data table in the workbook named <tt>name</tt>, or <tt>null</tt> if no table is named <tt>name</tt>. * @since 3.15 beta 2 */ public XSSFTable getTable(String name) { if (name != null && sheets != null) { for (XSSFSheet sheet : sheets) { for (XSSFTable tbl : sheet.getTables()) { if (name.equalsIgnoreCase(tbl.getName())) { return tbl; } } } } return null; }
private Map<String, XSSFTable> getTableCache() { if ( _tableCache != null ) { return _tableCache; } // FIXME: use org.apache.commons.collections.map.CaseInsensitiveMap _tableCache = new HashMap<>(); for (Sheet sheet : _uBook) { for (XSSFTable tbl : ((XSSFSheet)sheet).getTables()) { String lname = caseInsensitive(tbl.getName()); _tableCache.put(lname, tbl); } } return _tableCache; }
for (XSSFTable table : sheet.getTables()) { if (name.equals(table.getName())) { return new AreaReference(table.getStartCellReference(), table.getEndCellReference(), SpreadsheetVersion.EXCEL2007);
/** * Returns the data table with the given name (case insensitive). * * @param name the data table name (case-insensitive) * @return The Data table in the workbook named <tt>name</tt>, or <tt>null</tt> if no table is named <tt>name</tt>. * @since 3.15 beta 2 */ public XSSFTable getTable(String name) { if (name != null && sheets != null) { for (XSSFSheet sheet : sheets) { for (XSSFTable tbl : sheet.getTables()) { if (name.equalsIgnoreCase(tbl.getName())) { return tbl; } } } } return null; }
private Map<String, XSSFTable> getTableCache() { if ( _tableCache != null ) { return _tableCache; } // FIXME: use org.apache.commons.collections.map.CaseInsensitiveMap _tableCache = new HashMap<>(); for (Sheet sheet : _uBook) { for (XSSFTable tbl : ((XSSFSheet)sheet).getTables()) { String lname = caseInsensitive(tbl.getName()); _tableCache.put(lname, tbl); } } return _tableCache; }
XSSFWorkbook workbook = new XSSFWorkbook(new File("test.xlsx")); int numberOfSheets = workbook.getNumberOfSheets(); for(int sheetIdx = 0; sheetIdx < numberOfSheets; sheetIdx++) { XSSFSheet sheet = workbook.getSheetAt(sheetIdx); List<XSSFTable> tables = sheet.getTables(); for(XSSFTable t : tables) { System.out.println(t.getDisplayName()); System.out.println(t.getName()); System.out.println(t.getNumerOfMappedColumns()); } }
for (XSSFTable t : tables) { System.out.println(t.getDisplayName()); System.out.println(t.getName()); System.out.println(t.getNumerOfMappedColumns());
for (XSSFTable t : tables) { System.out.println(t.getDisplayName()); System.out.println(t.getName()); System.out.println(t.getNumerOfMappedColumns());
XSSFSheet childSheet = childWb.getSheetAt(i); for (XSSFTable table : childSheet.getTables()) { if (table.getName().equals(tableName)) { return createChildTable(childSheet, cell.getRowIndex()); XSSFSheet childSheet = (XSSFSheet) wb.getSheetAt(i); for (XSSFTable table : childSheet.getTables()) { if (table.getName().equals(paths.get(0))) { return createChildTable(childSheet, cell.getRowIndex());
XSSFSheet childSheet = childWb.getSheetAt(i); for (XSSFTable table : childSheet.getTables()) { if (table.getName().equals(tableName)) { return createChildTable(childSheet, cell.getRowIndex()); XSSFSheet childSheet = (XSSFSheet) wb.getSheetAt(i); for (XSSFTable table : childSheet.getTables()) { if (table.getName().equals(paths.get(0))) { return createChildTable(childSheet, cell.getRowIndex());
for (XSSFTable table : sheet.getTables()) { if (name.equals(table.getName())) { return new AreaReference(table.getStartCellReference(), table.getEndCellReference(), SpreadsheetVersion.EXCEL2007);