Hi friend I want your help.I am reading an excel file & writing data to access database it is writting correctly but if there is any blank space in excell sheet it is reading the next row & puting insted of blank data so next cell comes to balnk data cell.my code is like this
Sheet mySheet = myWorkBook.getSheetAt(0);
Iterator rowIter = mySheet.rowIterator();
while(rowIter.hasNext())
{
Row myRow = (XSSFRow) rowIter.next();
Iterator cellIter = myRow.cellIterator();
Vector cellStoreVector=new Vector();
String nextElement="";
while(cellIter.hasNext())
{
Cell myCell = (XSSFCell) cellIter.next();
System.out.println("Cell Type is :"+myCell.getCellType()+" | "+myCell.toString());
if(myCell.getCellType()==XSSFCell.CELL_TYPE_BLANK)
{
System.out.println("Blank data found ");
myCell.setCellValue("-");
cellStoreVector.addElement(myCell);
}
else
{
cellStoreVector.addElement(myCell);
}
}
System.out.println("");
cellVectorHolder.addElement(cellStoreVector);
}
}
catch (Exception e)
{
e.printStackTrace();
}
I have used XSSFCell.CELL_TYPE_BLANK but it is not going to this loop please help me.Thanks.