Thanks for letting me know David.

"Karr, David" <[EMAIL PROTECTED]> wrote: That strategy worked perfectly.  I was 
already using merged regions to
determine the "value" for a cell, so it was easy enough to generate a
report at the start showing all the cell coordinates with "hidden"
values.

> -----Original Message-----
> From: Anthony Andrews [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, April 05, 2007 11:42 PM
> To: POI Users List
> Subject: Re: How to detect hidden data "under" merged regions?
> 
> 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"  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.
> 

---------------------------------------------------------------------
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/



 
---------------------------------
Don't pick lemons.
See all the new 2007 cars at Yahoo! Autos.

Reply via email to