Hi,

      I am reading an excel file using SAX+XSSF method. While reading I am
saving the row numbers of each row from 'attributes.getValue("r")' of 'Row'
tag.
After validating data of each row in the application, i want to write error
at the last column of each row.
For writing the error ro excel I am using XSSFWorkbook alone.

*Issue:*

My sheet is having date at second row(first row is not used).On reading the
excel sheet, i will record the row number as 2.while validating i will
check if the date is a past date or not. If the date is a past date, i have
to write 'INVAlID DATE' at the last column of second row.
For that i am using the following code.

XSSFWorkbook workBook = new XSSFWorkbbok(filePath);
Sheet mySheet = workBook.getSheetAt(0);
Row errorRow = mySheet.getRow(errorRowNumber); //errorRowNumber = 2

But row returned is not the second row, but the 3rd row which has some
other data.

My Assumption: XSSFWorkbook will not consider the first empty row. It will
consider the second row(which has data) as the first row. So on getting row
with row number '2', it will return 3rd row.


Please let me know if my assumption is correct or not, if yes, how can i
resolve it?

-- 
*RENJITH R*
9446011990

Reply via email to