鍍金池/ 問答/網(wǎng)絡(luò)安全  Office/ Apache poi 怎么加粗顯示?

Apache poi 怎么加粗顯示?

想對Excel中某些cell值加粗顯示,使用的是最新的Apache poi jar包

    <dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi-ooxml</artifactId>
        <version>3.17</version>
    </dependency>

使用了下面的方法不起作用

    XSSFCellStyle cellStyle = wb.createCellStyle();
    XSSFFont font = wb.createFont();
    font.setBold(true);
    cellStyle.setFont(font);
    cell.setCellStyle(cellStyle);

并且bold默認就為true

set a boolean value for the boldness to use. If omitted, the default value is true.

所以怎么才能加粗顯示呢?

回答
編輯回答
神經(jīng)質(zhì)

最后發(fā)現(xiàn)原來只是Mac Numbers不支持而已

2017年7月4日 08:10