/** * Get the total number of columns in this table. * * @return the column count * @since 4.0.0 */ public int getColumnCount() { CTTableColumns tableColumns = ctTable.getTableColumns(); if(tableColumns == null) { return 0; } // Casting to int should be safe here - tables larger than the // sheet (which holds the actual data of the table) can't exists. return (int) tableColumns.getCount(); }
/** * @deprecated Use {@link #getColumnCount()} instead. * * @return the number of mapped table columns (see Open Office XML Part 4: chapter 3.5.1.4) */ @Deprecated @Removal(version = "4.2.0") public long getNumberOfMappedColumns() { return ctTable.getTableColumns().getCount(); }
/** * 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); }
/** * @return the number of mapped table columns (see Open Office XML Part 4: chapter 3.5.1.4) */ public long getNumerOfMappedColumns(){ return ctTable.getTableColumns().getCount(); }
/** * Get the total number of columns in this table. * * @return the column count * @since 4.0.0 */ public int getColumnCount() { CTTableColumns tableColumns = ctTable.getTableColumns(); if(tableColumns == null) { return 0; } // Casting to int should be safe here - tables larger than the // sheet (which holds the actual data of the table) can't exists. return (int) tableColumns.getCount(); }
/** * @deprecated Use {@link #getColumnCount()} instead. * * @return the number of mapped table columns (see Open Office XML Part 4: chapter 3.5.1.4) */ @Deprecated @Removal(version = "4.2.0") public long getNumberOfMappedColumns() { return ctTable.getTableColumns().getCount(); }
/** * 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); }
for (int i = 0; i < ctColumns.getCount(); i++) { ctColumns.removeTableColumn(0);