Return-Path: Delivered-To: apmail-poi-dev-archive@www.apache.org Received: (qmail 12168 invoked from network); 31 Oct 2009 14:04:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 31 Oct 2009 14:04:51 -0000 Received: (qmail 41520 invoked by uid 500); 31 Oct 2009 14:04:50 -0000 Delivered-To: apmail-poi-dev-archive@poi.apache.org Received: (qmail 41466 invoked by uid 500); 31 Oct 2009 14:04:50 -0000 Mailing-List: contact dev-help@poi.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "POI Developers List" Delivered-To: mailing list dev@poi.apache.org Received: (qmail 41447 invoked by uid 99); 31 Oct 2009 14:04:50 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 31 Oct 2009 14:04:50 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of dhoffer6@gmail.com designates 209.85.160.46 as permitted sender) Received: from [209.85.160.46] (HELO mail-pw0-f46.google.com) (209.85.160.46) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 31 Oct 2009 14:04:41 +0000 Received: by pwi12 with SMTP id 12so1228562pwi.5 for ; Sat, 31 Oct 2009 07:04:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=iPMNNJCVvmNf5JvyiKGfsdm9uAg+mAaBX/qD+2xAPDc=; b=OMBek7KOwGhT+2KXTpOfDxG51Fgey4N2niU+uXDpS1u1oaihRAesa7Diqq5FOu/g2Z VKqYPZePVyPClQHou7NVyoRIGdtoiuf7jVSpTiSQ8zQC4FaXGG3o0dut9drGpFAitQRC wYLxs4muXPB0CyVZpM+qVrTwkMqkUDbQ1gUO4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=MATDUXQVdDcoKi2Nr1Tc+HM2CBdsZj369zE4CsQXljqCVHRxYeVhM6kETOBI+b7Zq2 PBiLw+Thjtx6imcXJ5oeKqqXbIIQvAXGmVNDST1culvm3jUnp/u29H3PKiD9ZmHJ5vyL KHAL/rRrth1I3Er6acEGJlYLsQSfm1QuAiksg= MIME-Version: 1.0 Received: by 10.142.195.13 with SMTP id s13mr277964wff.3.1256997859960; Sat, 31 Oct 2009 07:04:19 -0700 (PDT) In-Reply-To: References: Date: Sat, 31 Oct 2009 08:04:19 -0600 Message-ID: Subject: Re: 3.5-FINAL causes corrupt cells after shiftRows() From: David Hoffer To: dev@poi.apache.org Cc: user@poi.apache.org Content-Type: multipart/alternative; boundary=000e0cd15754ed27a604773b9eb2 X-Virus-Checked: Checked by ClamAV on apache.org --000e0cd15754ed27a604773b9eb2 Content-Type: text/plain; charset=UTF-8 I have more info on this issue. What is happening is that in the row that has the 'missing cells' the old/previous row had an alignment of 'Merge cells' for columns A, B, C & D. Before I called shiftRows() I called sheet.removeRow(hssfRow). I did this at first because I thought it would delete the row and therefore move the desired data up. Once I found that it just deleted the contents of the rows I left it there but then I call shiftRows() to move the rows up. However after calling both of these methods the original row(s) still have their old/prior alignment/formatting. In Excel when you delete and/or move rows you don't get this mixed behavior. How can I get the desired behavior of cleaning removing all of the old and moving the new rows? Perhaps I'm doing something wrong but this seems like a bug in POI. I need a workaround for today. Thanks much! On Sat, Oct 31, 2009 at 7:40 AM, David Hoffer wrote: > I have a new application using POI version 3.5-FINAL and I am seeing what > appears to be a bug in POI. > > Everything is fine until I call shiftRows() on a sheet. I.e. > > sheet.shiftRows(firstRow.getRowIndex(), > lastRow.getRowIndex(), > 3 - firstRow.getRowIndex(), > true, > true); > > The problem is that after this call some of the cells in the row(s) are > missing their data. The cells had data before the move and now some are > just plan empty! > > What I am doing here is moving a set of rows up by a few rows. (And I have > previously cleared the rows I am moving into...perhaps I did not need to.) > I immediately save the workbook after this, e.g. > > workbook.write(new FileOutputStream(tempFile)); > > > Is this a known issue? How can I fix this? > > Just let me know if you need to see examples of the error. In my case some > cells in columns B & C are erased. > > Thanks! > > > --000e0cd15754ed27a604773b9eb2--