Apache POI:空行中的空单元格中的注释
我有一个Apache POI的大问题。
ABCD 1 text text text text 2 comment 3 text text text text
在这个例子中,第2行是空的,C2没有文本,而是注释。
如果我想获得第2行,POI将返回null。
如何从空行中的空单元格获得评论?
要获取任意的注释,而不直接通过Cell,可以使用Sheet.gteCellComment(int row,int cell)
从你的例子中,得到C2中的评论,做一些事情:
CellReference ref = new CellReference("C2") Comment commentC2 = sheet.getCellComment(ref.getRow(), ref.getCol());