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".
+
+