如何使用Cell获取Cell Reference?
我正在使用apache poi 3.11,来自CellReference,我可以使用以下代码获取rowIndex和Column Index。
CellReference cr = new CellReference("A1"); row = mySheet.getRow(cr.getRow()); cell = row.getCell(cr.getCol());
但我的rowIndex和columnIndex是动态生成的,如何使用rowIndex和columnIndex获取CellReference?
XSSFRow row = mySheet.getRow(rowIndex); XSSFCell cell = row.getCell(columnIndex);
使用CellReference类的CellReference(int pRow,int pCol)构造函数和创建的实例的formatAsString方法创建CellReference实例。
您可以通过以下静态方法获取字符串中的列,并将行号附加到结果列String
ColString= CellReference.convertNumToColString(columnIdex)