List of usage examples for org.apache.poi.ss.usermodel Sheet autoSizeColumn
void autoSizeColumn(int column, boolean useMergedCells);
From source file:guru.qas.martini.report.DefaultTraceabilityMatrix.java
License:Apache License
protected void resizeColumns(Sheet sheet) { for (int i = 0; i < columns.size(); i++) { sheet.autoSizeColumn(i, false); }//from ww w . j a va2 s . c o m }
From source file:org.pivot4j.ui.poi.ExcelExporter.java
License:Common Public License
/** * @param context//from w w w . j av a 2 s.c om * @param sheet */ protected void adjustColumnSizes(TableRenderContext context, Sheet sheet) { for (int i = 0; i < context.getColumnCount(); i++) { try { sheet.autoSizeColumn(getColOffset() + i, !mergedRegions.isEmpty()); } catch (Exception e) { // Ignore any problem while calculating size of the columns. } } }