I am using apache poi 3.11, from CellReference, I can get rowIndex and Column Index, using following code.
CellReference cr = new CellReference("A1");
row = mySheet.getRow(cr.getRow());
cell = row.getCell(cr.getCol());
But my rowIndex and columnIndex are generated dynamically, how can I get CellReference using rowIndex and columnIndex?
XSSFRow row = mySheet.getRow(rowIndex);
XSSFCell cell = row.getCell(columnIndex);
Create a CellReference instance using the CellReference(int pRow, int pCol) constructor of the CellReference class, and the formatAsString method of the created instance.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With