× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hello,

The HSSFWorkbook class has a getNumberOfSheets() method to tell you how many sheets it contains.

The HSSFSheet class has a getFirstRowNum() and getLastRowNum() to get the starting/ending row numbers. (Remember, rows do *not* have to start at 0, and there can be missing rows in the middle as well.)

The HSSFRow class has methods named getFirstRowNum() and getLastRowNum(). (Oddly, getLastRowNum() returns the highest row number + 1).. again, remember that cell numbers don't need to start
at 0, and there can be missing cells in the middle.

I personally do not use these methods, so I haven't prototyped them. You'll need to do that yourself.

You can find the JavaDocs for POI on Apache's web site, here:
http://poi.apache.org/apidocs/index.html



On 12/20/2011 10:21 AM, sjones@xxxxxxxxxxxxxxx wrote:
I am using HSSF to read a spreadsheet using:

row = HSSFSheet_getRow(sheet: RowIndex);
cell = HSSFRow_GetCell(row: ColIndex);

I increment RowIndex/ColIndex to move through the spreadsheet. How do I
determine when I have reached the end of the sheet? I tried chekcing row
for *null, but that didn't work.

Thanks

Steve Jones


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.