File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How can i get total number of rows excluding from BLANK SPACES from excel using apachi POI
 
Similar Threads
Uploading Excel spreadsheet into JSP
Problem in reading Numeric value as String fom Excel file using Apache POI
How to read .xlsx sheet from Client Side using poi 3.5
Read a .xls,.xlsx file format using XSSF
deleting blank row or null row in java ( HSSF)