当我尝试使用apache poi检查样式是否存在时,我只获得样式的索引。检查完样式后,我想显示特定样式的名称。谁能帮我?提前谢谢..
示例
checkStyle = 2
if(currentStyle != checkStyle)
"Left Align Not Present"
else
"Left Align Present"
这是我的代码
if(row?.getCell(curColOp)?.getCellStyle()?.getIndex() == tcOpRow?.getCell(curColOp)?.getCellStyle()?.getIndex()){
style.setFillForegroundColor(IndexedColors.RED.getIndex())
style.setFillPattern(CellStyle.SOLID_FOREGROUND)
row?.getCell(curColOp).setCellStyle(style)
}