aspose file tools*
The moose likes Other Open Source Projects and the fly likes How can i get total number of rows excluding from BLANK SPACES from excel using apachi POI Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "How can i get total number of rows excluding from BLANK SPACES from excel using apachi POI" Watch "How can i get total number of rows excluding from BLANK SPACES from excel using apachi POI" New topic
Author

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

Chintan H Patel
Greenhorn

Joined: Nov 17, 2010
Posts: 2
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

Joined: Jun 24, 2003
Posts: 3274
    
    5

Since you've edited that row, POI will add that row to the count, I'm not sure there's a way around that.


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How can i get total number of rows excluding from BLANK SPACES from excel using apachi POI