• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How can i get total number of rows excluding from BLANK SPACES from excel using apachi POI

 
Chintan H Patel
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
i have a issue with Apachi POI api scenerio is like below.
I have 10 records in my excel file and i am reading total no of rows with

int totalRows = sheet.getPhysicalNumberOfRows();

it returns me 10.

but when i open that excel file and add BLANK SPACE in 11th row and save and reading with same like

int totalRows = sheet.getPhysicalNumberOfRows();
it returns me 11.

but it should be return 10 and should be ignore BLANK SPACE from row.

Can you suggest me how can i get total number of rows excluding BLANK SPACES

 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since you've edited that row, POI will add that row to the count, I'm not sure there's a way around that.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic