You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Anthony Andrews <py...@yahoo.com> on 2008/08/01 08:44:52 UTC

Re: HSSFRegionUtil Deleting Cell Contents

The 'old' way to accomplish the task you are trying to achieve was to create a series of HSSFCellStyle objects and apply each to a specific cell. For example, you could create one with the border set on it's left hand and top edges then apply this to the cell that appears at the top left hand corner of the range in your case.

Of course, this is long winded, can get very complex to manage and does require you to create lots of objects but it would be a work-around for your current problem and something you could use whilst waiting for a fix in the behaviour of HSSFRegionUtil.

It may be worth your while creating a small, simple piece of code that illustrates the problem, checking to see if anyone has raised the issue as a bug and, if not, doing so yourself.

--- On Thu, 7/31/08, John Schroeder <js...@compliancecoach.com> wrote:
From: John Schroeder <js...@compliancecoach.com>
Subject: HSSFRegionUtil Deleting Cell Contents
To: user@poi.apache.org
Date: Thursday, July 31, 2008, 10:56 AM

Hi Everyone,

 

I'm having some problems with problems with the HSSFRegionUtil class that
are making it pretty much impossible to do what I need to.

 

I'm using POI to generate an Excel document that has 3 columns and several
sections each with a variable number of rows. After I populate all of the
cells, I'm creating a region around the section and using the
HSSFRegionUtil.setBorder* functions to put a border on each side of the
region.  For some reason after adding the border, a large number of the
cells are blank. The data all shows up as it should if I don't use any
borders, but when the borders are added it seems to wipe out some of the
data.  The data in the 3rd column is intact, some of the data in the 2nd
column is gone and the 1st column is entirely blank.  Has anyone encountered
this before? Is there anything I can do to avoid this?