Ok - so I realized that after writing some code and figuring out stuff, that jxl does not support xlsx, only POI (XSSF). Ok fine. What I am trying to do is search for a cell with a string value "Result" in a specified column. Once I find that, then as a test passes or fails, it writes "Pass" or "Fail" in the cell that is blank. And it will continue to do that until the test set has finished. Here is the code I wrote using jxl.
WritableWorkbook wb = Workbook.createWorkbook(new File(testData), workbook);
WritableSheet ws = wb.getSheet("OrderCreateQA3");
int colCount = ws.getColumns();
for(int j=0; j<colCount; j++){
Cell cell = ws.getCell(j,0);
if(cell.getContents().contains("Result")){
Cell[] cells = ws.getColumn(j);
int len = cells.length;
Label label = new Label(j,len, "Fail", getCellFormat(Colour.RED));
ws.addCell(label);
break;
}
}
wb.write();
wb.close();
The above was pretty straightforward, I find the string, then get that column name and write pass or fail given the length. Any ideas on how to do it using POI?