poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Panayotopoulos <Alex.Panayotopou...@vianet.co.uk>
Subject RE: POI doesnot read the Blank cell
Date Tue, 20 Sep 2011 08:06:19 GMT

You'll only see blank cells when they have been created, but they have no contents.
If a cell has never been created in the first place, the cell iterator will just skip over
it entirely; and when you specifically ask for it with sheet.getRow(y).getCell(x) you'll get
a null value back.

If you need to deal with these cases, try iterating numerically instead:
	for (int i = 0; i < row.getLastCellNum(); i++) {
		Cell c = row.getCell(i);
		if (c == null) {
			// ...
		} else {
			switch (c.getCellType()) {
				// ...

Hope that helps!

Alex Panayotopoulos

<font size="2" face="Verdana" color="grey">If you wish to view Brulines Group email
disclaimer please <a href="http://www.brulines.com/investors/emaildisclaimer.aspx">click

To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org

View raw message