我正在尝试使用Apache POI(版本3.10-FINAL)创建自定义大小的单元格注释,如下所示:
...
XSSFDrawing drawing = sheet.createDrawingPatriarch();
XSSFCell cell = sheet.getRow(row).getCell(col);
XSSFClientAnchor anchor = new XSSFClientAnchor(leftdx, topdx, rightdx, bottomdx, col1, row1, col2, row2);
XSSFComment comment = drawing.createCellComment(anchor);
cell.setCellComment(comment);
在创建HSSF表时,类似的代码运行良好,但现在使用xssf更改rightdx
- 值似乎不会影响注释大小。在调试时,我偶然发现了createCellComment
中org.apache.poi.xssf.usermodel.XSSFDrawing
中的以下代码 - class:
XSSFClientAnchor ca = (XSSFClientAnchor)anchor;
...
String position =
ca.getCol1() + ", 0, " + ca.getRow1() + ", 0, " +
ca.getCol2() + ", 0, " + ca.getRow2() + ", 0";
vmlShape.getClientDataArray(0).setAnchorArray(0, position);
这是否意味着任何传递的dx
- 值都会被忽略?我可以仅根据整个单元控制注释大小,还是我缺少某些内容?