Hi,
I'm trying to load data from 1 excel workbook with several sheets.
The first row on every sheet contains titles which I fetch first:
private void loadXlsColumns(int sheet) {
xlsColumns.clear();
for(int col=0;col<countCols(sheet, 0);col++) {
String value = (String) evalCell(getCell(sheet, 0, Short.parseShort(col+"")));
if ((value!=null) && (!value.equals("")) )
xlsColumns.add(value);
}
}
public int countCols(int sheet, int row) {
return workbook.getSheetAt(sheet).getRow(row).getLastCellNum();
}
public HSSFCell getCell(int sheet,int row,short column){
return workbook.getSheetAt(sheet).getRow(row).getCell(column);
}
Works fine for the first sheet. But whenever I want to do this with the next sheets, getCell() returns null. I've debuged the line and the parameters are correct. He gives null on sheet 1, row 0, cell 0, and there really is data on there. Is there anything I should do before I load the 2nd sheet ? Any ideas ?
Message was edited by:
ReggieBE