You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by rlloyd <rl...@mks.com> on 2011/05/18 21:14:41 UTC

Re: XSSFSheet.addMergedRegion giving excel error

I have encountered this problem also. I've written an app that iterates over
a hierarchy of data and uses POI XSSF to format that in a vertical table.
e.g. converting

Hazard
     Risk
          Risk Control
     Risk
          Risk Control

to an Excel output of:

Hazard     Risk     Risk Control
              Risk     Risk Control

I use the merge region capability to try and merge cells in the case where 1
Hazard has multiple Risks, or where 1 Risk has multiple Risk Controls.

I'm getting the same error as the posted above. I've attached the sheet1.xml
file from the ZIP that is outputted from POI and the version that MS Excel
repairs, to see if the difference is obvious.
http://apache-poi.1045710.n5.nabble.com/file/n4407440/XML_Sheets.zip
XML_Sheets.zip 




--
View this message in context: http://apache-poi.1045710.n5.nabble.com/XSSFSheet-addMergedRegion-giving-excel-error-tp3389764p4407440.html
Sent from the POI - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: XSSFSheet.addMergedRegion giving excel error

Posted by Nick Burch <ni...@alfresco.com>.
On Fri, 3 Jun 2011, atulk wrote:
> However this does work fine for the older .xls files and Excel does not
> complain.

I guess this means that the .xlsx format is stricter. OOI, if you open a 
.xls file with overlapping regions in excel and save it as a .xlsx, how 
does excel itself resolve it?

> Is this a POI bug or Excel bug? Seems like POI could provide some error 
> if conflicting merge regions are added or provide a validation routine 
> to see if a sheet contains conflicting merge regions and drop duplicates 
> if they are specified that would be great.

Sounds like a handy XSSF specific feature, please send in a patch if you 
manage to code something up to do it!

Cheers
Nick

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: XSSFSheet.addMergedRegion giving excel error

Posted by atulk <at...@hotmail.com>.
Hi,
We are using POI 3.1 and are trying to upgrade to POI 3.7 to provide XSLX
files. I am facing a similar problem as being described above.

The problem seems to be that if you have a duplicate mergecell definition
(you add the same merge region twice) or if you have a conflicting mergecell
definition then you get this error when opening the file in Excel. Excel
tells us that some data might be lost.

However this does work fine for the older .xls files and Excel does not
complain.

Is this a POI bug or Excel bug? Seems like POI could provide some error if
conflicting merge regions are added or provide a validation routine to see
if a sheet contains conflicting merge regions and drop duplicates if they
are specified that would be great.



--
View this message in context: http://apache-poi.1045710.n5.nabble.com/XSSFSheet-addMergedRegion-giving-excel-error-tp3389764p4452951.html
Sent from the POI - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org