You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Rodrigo Reyes <ro...@instaservi.com> on 2003/05/07 21:49:58 UTC
Detecting merged cells...
Hi
We have been using POI on a commercial project here, but we have had
some problems. First, the dowload area has not been updated, so the best jar
we could get was jakarta-poi-1.8.0-dev-20020919.jar. Where can we get a more
recent jar?
Now, is there anyway to know if a cell is merged? I couldn't find a
method neither on HSSFCell nor or HSSFSheet. I need this because I have been
trying to implement an insertRow method, and I have problems moving merged
cells.
Thanx in advance for your help...
Rodrigo
Re: Detecting merged cells...
Posted by Rodrigo Reyes <ro...@instaservi.com>.
Ohhh... ok. No I see it. :) Thanx, Danny
Rodrigo
----- Original Message -----
From: "Danny Mui" <da...@muibros.com>
To: "POI Users List" <po...@jakarta.apache.org>
Sent: Thursday, May 08, 2003 10:16 AM
Subject: Re: Detecting merged cells...
> Method signature for getMergedRegionAt :
> Region getMergedRegionAt (int index);
>
> That in combination with the size should be sufficient for your needs, no?
>
> danny
>
> Rodrigo Reyes wrote:
>
> >Danny
> > I see that with getNumMergedRegions you could know how many merged
> >regions there are in the sheet, but not where. And since
getMergedRegionAt
> >needs a Region, I can't use it without knowing the region to give. Am I
> >missing something?
> >
> >Rodrigo
> >
> >----- Original Message -----
> >From: "Danny Mui" <da...@muibros.com>
> >To: "POI Users List" <po...@jakarta.apache.org>
> >Sent: Thursday, May 08, 2003 9:33 AM
> >Subject: Re: Detecting merged cells...
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: poi-user-help@jakarta.apache.org
>
Re: Detecting merged cells...
Posted by Danny Mui <da...@muibros.com>.
Method signature for getMergedRegionAt :
Region getMergedRegionAt (int index);
That in combination with the size should be sufficient for your needs, no?
danny
Rodrigo Reyes wrote:
>Danny
> I see that with getNumMergedRegions you could know how many merged
>regions there are in the sheet, but not where. And since getMergedRegionAt
>needs a Region, I can't use it without knowing the region to give. Am I
>missing something?
>
>Rodrigo
>
>----- Original Message -----
>From: "Danny Mui" <da...@muibros.com>
>To: "POI Users List" <po...@jakarta.apache.org>
>Sent: Thursday, May 08, 2003 9:33 AM
>Subject: Re: Detecting merged cells...
>
>
Re: Detecting merged cells...
Posted by Rodrigo Reyes <ro...@instaservi.com>.
Danny
I see that with getNumMergedRegions you could know how many merged
regions there are in the sheet, but not where. And since getMergedRegionAt
needs a Region, I can't use it without knowing the region to give. Am I
missing something?
Rodrigo
----- Original Message -----
From: "Danny Mui" <da...@muibros.com>
To: "POI Users List" <po...@jakarta.apache.org>
Sent: Thursday, May 08, 2003 9:33 AM
Subject: Re: Detecting merged cells...
> If I'm not misktaken, you have the number of merged regions
> (getNumMergedRegions) and you have getMergedRegionAt method. Those two
> can get all of them for you no?
>
> If I recall correctly, Merged regions are tracked separately from
> cells. So, if cells need to shifted, the associated records
> (MergedRegion) have to be updated as well.
>
> danny
>
> Rodrigo Reyes wrote:
>
> >Danny
> > As far as I have seen, the merged cell methods are:
> > addMergedRegion(Region region)
> > getMergedRegionAt(int index)
> > getNumMergedRegions()
> > removeMergedRegion(int index)
> > Still, I haven't been able to find a way of detecting all the merged
> >regions a sheet has. Why do I need this? Because I am creating an
> >insertRow(int rowNum, HSSFSheet sheet) method and I keep having problems
> >with merged cells (I can't move them because all I can copy is the cell
> >value, the cell style and the cell type, and the merge attribute doesn't
> >seem to be any of those). I also read there are problems with
shiftRows(int
> >startRow, int endRow, int n) when trying to shift merged cells. Any idea
on
> >how to accomplish this? Thanx...
> >
> >Rodrigo
> >
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: poi-user-help@jakarta.apache.org
>
Re: Detecting merged cells...
Posted by Danny Mui <da...@muibros.com>.
If I'm not misktaken, you have the number of merged regions
(getNumMergedRegions) and you have getMergedRegionAt method. Those two
can get all of them for you no?
If I recall correctly, Merged regions are tracked separately from
cells. So, if cells need to shifted, the associated records
(MergedRegion) have to be updated as well.
danny
Rodrigo Reyes wrote:
>Danny
> As far as I have seen, the merged cell methods are:
> addMergedRegion(Region region)
> getMergedRegionAt(int index)
> getNumMergedRegions()
> removeMergedRegion(int index)
> Still, I haven't been able to find a way of detecting all the merged
>regions a sheet has. Why do I need this? Because I am creating an
>insertRow(int rowNum, HSSFSheet sheet) method and I keep having problems
>with merged cells (I can't move them because all I can copy is the cell
>value, the cell style and the cell type, and the merge attribute doesn't
>seem to be any of those). I also read there are problems with shiftRows(int
>startRow, int endRow, int n) when trying to shift merged cells. Any idea on
>how to accomplish this? Thanx...
>
>Rodrigo
>
>
>
Re: Detecting merged cells...
Posted by Rodrigo Reyes <ro...@instaservi.com>.
Danny
As far as I have seen, the merged cell methods are:
addMergedRegion(Region region)
getMergedRegionAt(int index)
getNumMergedRegions()
removeMergedRegion(int index)
Still, I haven't been able to find a way of detecting all the merged
regions a sheet has. Why do I need this? Because I am creating an
insertRow(int rowNum, HSSFSheet sheet) method and I keep having problems
with merged cells (I can't move them because all I can copy is the cell
value, the cell style and the cell type, and the merge attribute doesn't
seem to be any of those). I also read there are problems with shiftRows(int
startRow, int endRow, int n) when trying to shift merged cells. Any idea on
how to accomplish this? Thanx...
Rodrigo
----- Original Message -----
From: "Danny Mui" <da...@muibros.com>
To: "POI Users List" <po...@jakarta.apache.org>
Sent: Wednesday, May 07, 2003 2:58 PM
Subject: Re: Detecting merged cells...
> The latest packaged release is located here:
> http://jakarta.apache.org/builds/jakarta-poi/dev/bin/
> Check out the >1.10< releases, stay tuned for 2.0pre!
>
> Or you can use CVS to retrieve the latest and greatest.
> http://jakarta.apache.org/site/cvsindex.html
>
> with the module being jakarta-poi
>
>
http://jakarta.apache.org/poi/javadocs/org/apache/poi/hssf/usermodel/HSSFShe
et.html
> Contains a few get methods for merged regions. this corresponds to the
> latest and greatest (HEAD) but the 1.10.x releases should have this
> functionality too.
>
>
>
> Rodrigo Reyes wrote:
>
> >Hi
> > We have been using POI on a commercial project here, but we have had
> >some problems. First, the dowload area has not been updated, so the best
jar
> >we could get was jakarta-poi-1.8.0-dev-20020919.jar. Where can we get a
more
> >recent jar?
> > Now, is there anyway to know if a cell is merged? I couldn't find a
> >method neither on HSSFCell nor or HSSFSheet. I need this because I have
been
> >trying to implement an insertRow method, and I have problems moving
merged
> >cells.
> > Thanx in advance for your help...
> >
> >Rodrigo
> >
> >
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: poi-user-help@jakarta.apache.org
> >
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: poi-user-help@jakarta.apache.org
>
Re: Detecting merged cells...
Posted by Danny Mui <da...@muibros.com>.
The latest packaged release is located here:
http://jakarta.apache.org/builds/jakarta-poi/dev/bin/
Check out the >1.10< releases, stay tuned for 2.0pre!
Or you can use CVS to retrieve the latest and greatest.
http://jakarta.apache.org/site/cvsindex.html
with the module being jakarta-poi
http://jakarta.apache.org/poi/javadocs/org/apache/poi/hssf/usermodel/HSSFSheet.html
Contains a few get methods for merged regions. this corresponds to the
latest and greatest (HEAD) but the 1.10.x releases should have this
functionality too.
Rodrigo Reyes wrote:
>Hi
> We have been using POI on a commercial project here, but we have had
>some problems. First, the dowload area has not been updated, so the best jar
>we could get was jakarta-poi-1.8.0-dev-20020919.jar. Where can we get a more
>recent jar?
> Now, is there anyway to know if a cell is merged? I couldn't find a
>method neither on HSSFCell nor or HSSFSheet. I need this because I have been
>trying to implement an insertRow method, and I have problems moving merged
>cells.
> Thanx in advance for your help...
>
>Rodrigo
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: poi-user-help@jakarta.apache.org
>
>
>