It is possible to obtain a list of all of the merged ranges of cells in the 
sheet. I have never done this in practice but I think that you will need to 
call the getNumMergedRegions() method on the sheet to recover an int value 
indicating the number of merged regions and then use a for loop to iterate 
through calling the getMergedRegionAt() method to recover a Region object that 
identifies - amongst other things - the co-ordinates of the cells at the top 
left hand and bottom right hand corners of the cell.

Knowing the locations and sizes of all of the merged regions, you could write a 
simple method to iterate through the cells contained within each merged range 
and simply check to see if any bar the top left hand cell contains a value. 
Best I can think of at this time in the morning.

"Karr, David" <[EMAIL PROTECTED]> wrote: I just discovered a curious anomaly in 
a large spreadsheet I'm parsing
with POI.  I discovered that there is at least one merged region (1 row,
2 columns) that shows a particular value when I view it in Excel, but I
discovered that there is hidden data "under" the merged region in the
second cell in the merged region.  If I use POI to just iterate through
all the rows and columns, retrieving the cell data, it shows the value
that I can see in the merged region (from the first column cell), but
also the value from the second column cell.  I can also see this in
Excel if I select the entire second column, then "Copy", then paste into
an external editor.  It shows the hidden value.

I need to figure out a way to detect this kind of condition with POI.
If the cell is hidden like this, I want to ignore it.  Can merged
regions tell me this somehow?

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/



 
---------------------------------
TV dinner still cooling?
Check out "Tonight's Picks" on Yahoo! TV.

Reply via email to