' XSSFCellStyle.SOLID_FOREGROUND',' XSSFCellStyle.ALIGN_RIGHT'和' HSSFCellStyle.BORDER_MEDIUM' POI 3.17的替代方案

时间:2018-05-28 10:39:23

标签: java apache-poi

我正在使用poi-3.6,我需要将源文件更新为poi 3.17。我需要知道' XSSFCellStyle.SOLID_FOREGROUND',' XSSFCellStyle.ALIGN_RIGHT'和' HSSFCellStyle.BORDER_MEDIUM' poi的替代方案3.17。

    CellStyle fontBoldedCell = ExcelCommon.getFontBoldedCell(workbook);
    Sheet sheet = workbook.getSheetAt(0);

    row = sheet.createRow(currrow++);
    cell = row.createCell(0);
    cell.setCellValue("Total Records");
    cell = row.createCell(1);
    cell.setCellValue(count);
    cell.setCellStyle(ExcelCommon.getAligneCell(workbook, null, XSSFCellStyle.ALIGN_RIGHT));

    Font font = workbook.createFont();
    font.setBold(true);
    CellStyle style = workbook.createCellStyle();
    style.setFont(font);
    style.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex());
    style.setFillPattern(XSSFCellStyle.SOLID_FOREGROUND);
    style.setBorderTop(BorderStyle.THIN);
    style.setBorderRight(BorderStyle.THIN);
    style.setBorderLeft(BorderStyle.THIN);
    style.setBorderBottom(BorderStyle.THIN);
    return style;    

    CellStyle style = workbook.createCellStyle();
    Font font = workbook.createFont();
    style.setFont(font);
    style.setBorderBottom(HSSFCellStyle.BORDER_MEDIUM);

0 个答案:

没有答案