Return-Path: X-Original-To: apmail-poi-user-archive@www.apache.org Delivered-To: apmail-poi-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BFF2D7E0C for ; Tue, 20 Sep 2011 08:06:48 +0000 (UTC) Received: (qmail 16079 invoked by uid 500); 20 Sep 2011 08:06:48 -0000 Delivered-To: apmail-poi-user-archive@poi.apache.org Received: (qmail 16060 invoked by uid 500); 20 Sep 2011 08:06:48 -0000 Mailing-List: contact user-help@poi.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "POI Users List" Delivered-To: mailing list user@poi.apache.org Received: (qmail 16051 invoked by uid 99); 20 Sep 2011 08:06:48 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Sep 2011 08:06:48 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [62.255.170.161] (HELO mail.brulines.com) (62.255.170.161) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Sep 2011 08:06:42 +0000 Received: from EXCH-BRU01-VM.Maingroup.Loc ([172.20.10.3]) by EXCH-BRU01-vm ([172.20.10.3]) with mapi id 14.01.0289.001; Tue, 20 Sep 2011 09:06:19 +0100 From: Alex Panayotopoulos To: POI Users List Subject: RE: POI doesnot read the Blank cell Thread-Topic: POI doesnot read the Blank cell Thread-Index: AQHMdw+gif3zHLQBak6YACRgEsgnrZVV3ncQ Date: Tue, 20 Sep 2011 08:06:19 +0000 Message-ID: <34B7A2DF57A3F14E8FC31FA0D166EB890B87C3@EXCH-BRU01-vm> References: In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.20.70.105] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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: =20 for (int i =3D 0; i < row.getLastCellNum(); i++) { Cell c =3D row.getCell(i); if (c =3D=3D null) { // ... } else { switch (c.getCellType()) { // ... } } } Hope that helps! --=20 Alex Panayotopoulos If you wish to view= Brulines Group email disclaimer please click= here --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@poi.apache.org For additional commands, e-mail: user-help@poi.apache.org