We had a similar issue with an older application we wrote - clients where deleting the contents of the cells/rows, but Excel still counts them. You can see this in Excel if you go to the end of the sheet (ctl-end on windows) - the blank rows are still there.
At first we created a business process where the client would delete the rows (right click, Delete...) and save the file. This cleared up the blank rows. However, we could not rely on the users to always follow this procedure. So, we had to write a little function that checks if there is any data in the cells.rows and omits them from the count. It is a nasty performance issue, but we were dealing with relatively small sheets and a set number of columns. With that said, this was with an older version of POI so there is probably a better way to do it now. Just an idea in case you are against a wall. -Lou Jonathan Sansalone <[email protected]> wrote on 2012-06-14 01:59:25 PM: > Jonathan Sansalone <[email protected]> > 2012-06-14 02:00 PM > > Please respond to > "POI Users List" <[email protected]> > > To > > <[email protected]>, > > cc > > Subject > > Using the Jakarta POI to count the rows of the excel file > > > Hi, my name is Jonathan and I am using POI api to count lines of an > excel file, but if I delete a line in the file, it will also be > counted along with the other. What can I do? > Jonathan Sansalone P. Rolim > > Programador Júnior - Java Standard Edition Programador Júnior - Java > Enterprise Edition > Sistemas de Informação - 2012 >
