POI自定义column width

阅读更多

POI设置自定义column width

...
Cell oosCell = orow.createCell(oosCellNum);
Sheet oSheet = outputWb.createSheet("输出结果");
oSheet.setColumnWidth(oosCellNum, 8 * 256);
oosCell.setCellValue(oosPass);
switch (oosPass){
   case XlsxFileUtils.OOS_PASS:
      oosCell.setCellStyle(greenStyle);
      break;

   case XlsxFileUtils.OOS_FAILED:
   case XlsxFileUtils.OOS_ERROR:
      oosCell.setCellStyle(redStyle);
      break;
}

你可能感兴趣的:(POI)