alibaba / easyexcel

快速、简洁、解决大文件内存溢出的java处理Excel工具
https://easyexcel.opensource.alibaba.com
Apache License 2.0
32.09k stars 7.5k forks source link

无法正确拿到表头字体样式 #3828

Closed li-xin-code closed 3 months ago

li-xin-code commented 3 months ago

默认样式导出,通过CellWriteHandler.afterCellDispose>context.getHeadData()>head.head.getHeadStyleProperty()或者head.getHeadFontProperty()拿到都是null。

li-xin-code commented 3 months ago

翻半天源码找到,藏太深了 WriteCellData<?> headData = cellDataList.stream().findFirst().orElseThrow(() -> new RuntimeException("cannot get WriteCellData.")); WriteCellStyle style = headData.getWriteCellStyle(); WriteFont font = style.getWriteFont();