如何使用Cell获取Cell Reference?

278*_*184 4 java apache-poi

我正在使用apache poi 3.11,来自CellReference,我可以使用以下代码获取rowIndex和Column Index.

CellReference cr = new CellReference("A1");
row = mySheet.getRow(cr.getRow());
cell = row.getCell(cr.getCol());
Run Code Online (Sandbox Code Playgroud)

但我的rowIndex和columnIndex是动态生成的,如何使用rowIndex和columnIndex获取CellReference?

XSSFRow row = mySheet.getRow(rowIndex); 
XSSFCell cell = row.getCell(columnIndex);
Run Code Online (Sandbox Code Playgroud)

Pet*_*sen 6

使用CellReference类的CellReference(int pRow,int pCol)构造函数和创建的实例的formatAsString方法创建CellReference实例.