/** * Remove table references and relations * @param t table to remove */ public void removeTable(XSSFTable t) { long id = t.getCTTable().getId(); Map.Entry<String, XSSFTable> toDelete = null; for (Map.Entry<String, XSSFTable> entry : tables.entrySet()) { if (entry.getValue().getCTTable().getId() == id) toDelete = entry; } if (toDelete != null) { removeRelation(getRelationById(toDelete.getKey()), true); tables.remove(toDelete.getKey()); toDelete.getValue().onTableDelete(); } }
/** * set sheet title in excel file * * @param title * title of sheet * @param column * column index * @return return cell reference * @since POI 4.0.0 */ public CellReference setSheetTitle(String title, int column) { XSSFSheet sheet = getSheet(); XSSFRow row = this.getRow(sheet, 0); XSSFCell cell = this.getCell(row, column); cell.setCellValue(title); this.updateSheetTable(sheet.getTables().get(0).getCTTable(), title, column); return new CellReference(sheet.getSheetName(), 0, column, true, true); }
XSSFTable table = rp.getDocumentPart(); tbl.setId(rp.getRelationship().getId()); table.getCTTable().setId(tableNumber);
CTTableColumns ctTableColumns = getCTTable().getTableColumns(); if(ctTableColumns != null) { for (CTTableColumn col : ctTableColumns.getTableColumnList()) {
/** * Remove table references and relations * @param t table to remove */ public void removeTable(XSSFTable t) { long id = t.getCTTable().getId(); Map.Entry<String, XSSFTable> toDelete = null; for (Map.Entry<String, XSSFTable> entry : tables.entrySet()) { if (entry.getValue().getCTTable().getId() == id) toDelete = entry; } if (toDelete != null) { removeRelation(getRelationById(toDelete.getKey()), true); tables.remove(toDelete.getKey()); toDelete.getValue().onTableDelete(); } }
/** * set sheet title in excel file * * @param title * title of sheet * @param column * column index * @return return cell reference * @since POI 4.0.0 */ public CellReference setSheetTitle(String title, int column) { XSSFSheet sheet = getSheet(); XSSFRow row = this.getRow(sheet, 0); XSSFCell cell = this.getCell(row, column); cell.setCellValue(title); this.updateSheetTable(sheet.getTables().get(0).getCTTable(), title, column); return new CellReference(sheet.getSheetName(), 0, column, true, true); }
CTTable cttable = my_table.getCTTable();
table.getCTTable().addNewTableStyleInfo(); table.getCTTable().getTableStyleInfo().setName("TableStyleMedium2");
XSSFTable table = rp.getDocumentPart(); tbl.setId(rp.getRelationship().getId()); table.getCTTable().setId(tableNumber);
CTTableColumns ctTableColumns = getCTTable().getTableColumns(); if(ctTableColumns != null) { for (CTTableColumn col : ctTableColumns.getTableColumnList()) {
CTTable cttable = table.getCTTable(); table.setDisplayName("table"); cttable.setRef("A1:C4");
XSSFTable table = sheet.createTable(); table.setDisplayName(name); CTTable cttable = table.getCTTable();