/** * Get the name of the column, which is is unique per table. * * @return the column name * @since 4.0.0 */ public void setName(String columnName) { ctTableColumn.setName(columnName); }
/** * this method update column header of sheet into table * * @param ctTable * xssf table object * @param title * title of column * @param index * index of column */ private void updateSheetTable(CTTable ctTable, String title, int index) { CTTableColumns tableColumnList = ctTable.getTableColumns(); CTTableColumn column = null; for( int i = 0; tableColumnList.getCount() < index; i++) { column = tableColumnList.addNewTableColumn(); column.setId(i); } column = tableColumnList.getTableColumnArray(index); column.setName(title); }
XSSFCell cell = row.getCell(cellnum); if (cell != null) { col.setName(formatter.formatCellValue(cell));
/** * Get the name of the column, which is is unique per table. * * @return the column name * @since 4.0.0 */ public void setName(String columnName) { ctTableColumn.setName(columnName); }
CTTableColumns ctColumns = ctTable.addNewTableColumns(); CTAutoFilter autofilter = ctTable.addNewAutoFilter(); ctColumns.setCount(table_headers.size()); for(int i = 0; i < table_headers.size(); i++) { CTTableColumn column = ctColumns.addNewTableColumn(); column.setName(table_headers.get(i)); column.setId(i + 1); CTFilterColumn filter = autofilter.addNewFilterColumn(); filter.setColId(i + 1); filter.setShowButton(true); }
private void wrapColumns(Table table) { CTTable ctTable = table.getCTTable(); for (CTTableColumn column : ctTable.getTableColumns().getTableColumnArray()) { column.setName(WrappingUtil.wrapTableColumnName(column.getName())); } }
/** * this method update column header of sheet into table * * @param ctTable * xssf table object * @param title * title of column * @param index * index of column */ private void updateSheetTable(CTTable ctTable, String title, int index) { CTTableColumns tableColumnList = ctTable.getTableColumns(); CTTableColumn column = null; for( int i = 0; tableColumnList.getCount() < index; i++) { column = tableColumnList.addNewTableColumn(); column.setId(i); } column = tableColumnList.getTableColumnArray(index); column.setName(title); }
/** * Synchronize table headers with cell values in the parent sheet. * Headers <em>must</em> be in sync, otherwise Excel will display a * "Found unreadable content" message on startup. */ @SuppressWarnings("deprecation") public void updateHeaders(){ XSSFSheet sheet = (XSSFSheet)getParent(); CellReference ref = getStartCellReference(); if(ref == null) return; int headerRow = ref.getRow(); int firstHeaderColumn = ref.getCol(); XSSFRow row = sheet.getRow(headerRow); if (row != null && row.getCTRow().validate()) { int cellnum = firstHeaderColumn; for (CTTableColumn col : getCTTable().getTableColumns().getTableColumnArray()) { XSSFCell cell = row.getCell(cellnum); if (cell != null) { col.setName(cell.getStringCellValue()); } cellnum++; } } }
column.setName("Column" + i); column.setId(i+1);
column.setName(tableHeaders.get(i)); column.setId(i + 1);
@Override public void process(XLXContext context) throws Exception { String style = context.getReportContext().getTableStyleName(); if(style != null){ table.getCTTable().getTableStyleInfo().setName(style); } for(CTTableColumn c : table.getCTTable().getTableColumns().getTableColumnArray()){ Object name = CellExpressionParser.parseExpression(c.getName()).evaluate(context); if(name != null){ c.setName(name.toString()); } } if(header != null){ context.setTableStartHeader(); header.process(context); context.endTableHeader(); generateXMLMap(context); } String tableStartRef = startTable(context); long row = context.getCurrentRow(); forEach.process(context); if(row == context.getCurrentRow()){ context.nextRow();//insert empty row } if(totals != null){ totals.process(context); } processTable(context, tableStartRef); }
XSSFCell cell = row.getCell(cellnum); if (cell != null) { col.setName(formatter.formatCellValue(cell));
CTTableColumn column = columns.addNewTableColumn(); column.setId(++i); column.setName(colName);
column.setName("Column" + i);