I am having an problem, while java application reading Excel file .xlsx extention, The application is working normally, but in the workbook has many sheets, 1, 2 sheets reading correctly , but when reads 3 sheet, there does not read all the cells and while I opened and checked from Excel file, cell is exists with empty values, but when apache poi reading it the cell is just ignored the empty cells. What is a cause? Update
FileInputStream file = new FileInputStream(file_location);
//this.workbook = new HSSFWorkbook(file);
this.workbook = new XSSFWorkbook(file);
XSSFSheet mySheet = workbook.getSheetAt(index);
Iterator rowIter = mySheet.rowIterator();
while(rowIter.hasNext()){
XSSFRow myRow = (XSSFRow) rowIter.next();
Iterator cellIter = myRow.cellIterator();
ArrayList colStoreArray=new ArrayList();
while(cellIter.hasNext()){
XSSFCell myCell = (XSSFCell) cellIter.next();
colStoreArray.add(myCell);
}
rowArrayHolder.add(colStoreArray);
} }
Above the reading excel file, While i checked the Excel file there in one row 20 cells, but while it reads in some rows only 14 rows. I am using ArrayList, seems here should be problem with the concurrent accessing the ArrayList. What can be cause?