From 54b958b1a90320267dc559eb4e3791b5363d09c3 Mon Sep 17 00:00:00 2001 From: Yegor Kozlov Date: Thu, 30 Jul 2009 13:49:25 +0000 Subject: [PATCH] added a note on Compatibility of POI-generated .xlsx files with MS Office 2008 for Mac SP2 git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@799264 13f79535-47bb-0310-9956-ffa450edef68 --- .../content/xdocs/spreadsheet/index.xml | 31 +++++++++++++++++++ src/documentation/content/xdocs/status.xml | 3 +- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/src/documentation/content/xdocs/spreadsheet/index.xml b/src/documentation/content/xdocs/spreadsheet/index.xml index bddd79c6b..d385c9952 100644 --- a/src/documentation/content/xdocs/spreadsheet/index.xml +++ b/src/documentation/content/xdocs/spreadsheet/index.xml @@ -66,5 +66,36 @@ can also generate spreadsheets this way.

+
+ Compatibility of POI-generated .xlsx files with MS Office 2008 for Mac SP2 +

+ Office 2008 for Mac SP2 version 12.2.0 has a serious bug causing some Open XML files to fail to open. + This bug is affecting Open XML files from a variety of sources including the Apache POI project. + The Apache POI project adjusted the XSSF module to produce "MS-compatible OOXML" by setting the Application extended property to "Microsoft Excel". This will allow users of future versions of Apache POI to produce OOXML documents that will work with Office 2008 for Mac SP2. + Please see Bugzilla 47559 for more information. +

+

+ Users are advised to patch existing .xlsx files by the following code: +

+ + XSSFWorkbook wb = new XSSFWorkbook(path); + + POIXMLProperties.ExtendedProperties ext = wb.getProperties().getExtendedProperties(); + expProps.getUnderlyingProperties().setApplication("Microsoft Excel"); + + FileOutputStream out = new FileOutputStream(path); + wb.write(out); + out.close(); + +

To unset the Application property use the following code:

+ + POIXMLProperties.ExtendedProperties ext = workbook.getProperties().getExtendedProperties(); + expProps.getUnderlyingProperties().unsetApplication(); + + + This is an effective workaround for a short-term bug which is likely to be removed in future versions of POI, + when Microsoft returns to compliance with the standard. The proper value for Apache POI created documents would to be "Apache POI" and not "Microsoft Excel". + +
diff --git a/src/documentation/content/xdocs/status.xml b/src/documentation/content/xdocs/status.xml index a3ca8ccbf..af9bb5a6b 100644 --- a/src/documentation/content/xdocs/status.xml +++ b/src/documentation/content/xdocs/status.xml @@ -37,7 +37,8 @@ 47571 - Fixed XWPFWordExtractor to extract inserted/deleted text 47548 - Fixed RecordFactoryInputStream to properly read continued DrawingRecords 46419 - Fixed compatibility issue with OpenOffice 3.0 - 47559 - Fixed compatibility issue with Excel 2008 Mac sp2 + 47559 - Fixed compatibility issue with Excel 2008 Mac sp2. Please see + the HSSF+XSSF project page for more information. 47540 - Fix for saving custom and extended OOXML properties 47535 - Fixed WordExtractor to tolerate files with empty footnote block 47517 - Fixed ExtractorFactory to support .xltx and .dotx files