You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2008/12/19 13:45:20 UTC
DO NOT REPLY [Bug 46419] New: XSSFWorkbook.wirte() file format error
https://issues.apache.org/bugzilla/show_bug.cgi?id=46419
Summary: XSSFWorkbook.wirte() file format error
Product: POI
Version: 3.5-dev
Platform: PC
OS/Version: Windows XP
Status: NEW
Severity: major
Priority: P2
Component: XSSF
AssignedTo: dev@poi.apache.org
ReportedBy: jmvazquez@lomg.net
Created an attachment (id=23038)
--> (https://issues.apache.org/bugzilla/attachment.cgi?id=23038)
Saved xlsx file using the specified code. Very simple xlsx file. Open Office
3.0 don't recognize it
Using this code to load an xlsx file and save it in another path with o without
changes.
Workbook xlsDocument=null;
try {
xlsDocument = WorkbookFactory.create(new FileInputStream(pathOriginal));
} catch (FileNotFoundException ex) {
ex.printStackTrace();
} catch (Exception ex) {
ex.printStackTrace();
}
FileOutputStream fos = new FileOutputStream(pathTemp);
xlsDocument.write(fos);
fos.flush();
fos.close();
The saved file contains file format errors.
If the saved file is a complex file,
when you try to open it with excel, it says that the file is damaged but
sometimes can repair it. With simples files (including the most simple file,
only one cell with a simple text content) excel can open the file without
errors. But if you try to open the saved file using OpenOffice
3.0 which supports xlsx file format. OpenOffice 3.0 can open the original
xlsx file without problems, but the saved file isn't recognized by
OpenOffcie 3.0.
If you open the saved file with excel and save it again (usign save option
from excel), now OpenOffice can open it without problems, so I supose that
exists a save bug that causes a format problem that usually can be repaired
by excel, but never can be repaired by OpenOffice.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
DO NOT REPLY [Bug 46419] XSSFWorkbook.wirte() file format error
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46419
Jose Miguel <jm...@lomg.net> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #23038|0 |1
is obsolete| |
--- Comment #5 from Jose Miguel <jm...@lomg.net> 2009-01-22 04:41:44 PST ---
Created an attachment (id=23160)
--> (https://issues.apache.org/bugzilla/attachment.cgi?id=23160)
Saved file using Apache POI. No changes from the original file
Open office can´t open this file.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
DO NOT REPLY [Bug 46419] XSSFWorkbook.write() file format error
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46419
--- Comment #12 from Leif Nelson <ln...@llnl.gov> 2009-07-27 07:45:43 PST ---
Thank you Yegor! I will remove my workaround for around this :-)
--Leif
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
DO NOT REPLY [Bug 46419] XSSFWorkbook.wirte() file format error
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46419
--- Comment #6 from Jose Miguel <jm...@lomg.net> 2009-01-22 04:42:50 PST ---
I attached the Original file and the saved file which I have the problem. I can
open the saved file with Office Excel, but not with OpenOffice Calc. I only
opened and saved the the file without changes and in a different path.
Sorry but we had a lot of problems to can unprotect the file and publish it.
Thanks.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
DO NOT REPLY [Bug 46419] XSSFWorkbook.wirte() file format error
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46419
Leif Nelson <ln...@llnl.gov> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #24027|OpenOfficeXlsxRepair.java - |OpenOfficeXlsxRepair.java -
description|simple java class that |simple java class that
|works around OpenOffice |works around OpenOffice
|issues |issues - uses truezip:
| |https://truezip.dev.java.ne
| |t/
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
DO NOT REPLY [Bug 46419] XSSFWorkbook.write() file format error
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46419
--- Comment #13 from Jose Miguel <jm...@lomg.net> 2009-07-28 03:07:23 PST ---
Thanks Yegor and Leif for solving the bug.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
DO NOT REPLY [Bug 46419] XSSFWorkbook.write() file format error
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46419
Yegor Kozlov <ye...@dinom.ru> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
--- Comment #11 from Yegor Kozlov <ye...@dinom.ru> 2009-07-24 01:40:08 PST ---
I fixed POI to produce files compatible with OpenOffice.
The fix was committed in r797350 ( https://svn.apache.org/viewcvs.cgi?view=rev&rev=797350 )
Yegor
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
DO NOT REPLY [Bug 46419] XSSFWorkbook.wirte() file format error
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46419
--- Comment #10 from Leif Nelson <ln...@llnl.gov> 2009-07-23 07:45:43 PST ---
(In reply to comment #9)
> Created an attachment (id=24027)
--> (https://issues.apache.org/bugzilla/attachment.cgi?id=24027) [details]
> OpenOfficeXlsxRepair.java - simple java class that works around OpenOffice
> issues
FYI. This class uses truezip to manipulate the contents of the xlsx zip file:
https://truezip.dev.java.net/
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
DO NOT REPLY [Bug 46419] XSSFWorkbook.wirte() file format error
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46419
--- Comment #4 from Jose Miguel <jm...@lomg.net> 2009-01-22 04:39:33 PST ---
Created an attachment (id=23159)
--> (https://issues.apache.org/bugzilla/attachment.cgi?id=23159)
Original xlsx fiel (before saving)
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
DO NOT REPLY [Bug 46419] XSSFWorkbook.wirte() file format error
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46419
Yegor Kozlov <ye...@dinom.ru> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEEDINFO |ASSIGNED
--- Comment #2 from Yegor Kozlov <ye...@dinom.ru> 2008-12-21 05:52:11 PST ---
I think it is a bug in OpenOffice, not in POI. I files and issue, let's wait
for feedback from OO guys:
http://www.openoffice.org/issues/show_bug.cgi?id=97460
Description:
OpenOffice can't read core OOXML relationships if a part name starts with a
forward slash character '/'.
For example, if the main document part is referenced as "/xl/workbook.xml" then
OpenOffice Calc fails to open it. If the main part is referenced as
"xl/workbook.xml" (without the leading slash), then the file is opened OK.
The part name grammar implies the forward slash constraint. See OOXML Open
Packaging Conventions, Package model conformance requirements:
M1.4 A part name shall start with a forward slash (“/”) character.
This constraint doesn't seem to be mandatory. Excel 2007 writes package part
names without the leading slash and doesn't require it when reading files. Both
"xl/workbook.xml" and "/xl/workbook.xml" part names seem to be valid, although
only the first one is OK in OpenOffice 3.0.
So, I think OO should support package part names starting with a forward slash.
Yegor
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
DO NOT REPLY [Bug 46419] XSSFWorkbook.wirte() file format error
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46419
Leif Nelson <ln...@llnl.gov> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |lnelson@llnl.gov
--- Comment #7 from Leif Nelson <ln...@llnl.gov> 2009-06-26 08:14:49 PST ---
*** Bug 47432 has been marked as a duplicate of this bug. ***
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
DO NOT REPLY [Bug 46419] XSSFWorkbook.wirte() file format error
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46419
--- Comment #9 from Leif Nelson <ln...@llnl.gov> 2009-07-23 07:42:47 PST ---
Created an attachment (id=24027)
--> (https://issues.apache.org/bugzilla/attachment.cgi?id=24027)
OpenOfficeXlsxRepair.java - simple java class that works around OpenOffice
issues
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
DO NOT REPLY [Bug 46419] XSSFWorkbook.wirte() file format error
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46419
--- Comment #8 from Leif Nelson <ln...@llnl.gov> 2009-07-23 07:40:42 PST ---
I wrote a simple java class to work around this issue and make the xlsx files
generated by POI compatible with OpenOffice. We use it when generating all of
our xlsx files as an interim solution while the OpenOffice bug sits there and
does nothing :-) It is attached as OpenOfficeXlsxRepair.java
--Leif
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
DO NOT REPLY [Bug 46419] XSSFWorkbook.write() file format error
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46419
David Fisher <df...@jmlafferty.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|XSSFWorkbook.wirte() file |XSSFWorkbook.write() file
|format error |format error
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
DO NOT REPLY [Bug 46419] XSSFWorkbook.wirte() file format error
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46419
Jose Miguel <jm...@lomg.net> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jmvazquez@lomg.net
--- Comment #3 from Jose Miguel <jm...@lomg.net> 2008-12-29 04:53:43 PST ---
Sorry for not responding, but I was on holiday.
I agree that can exist an OpenOffice bug as you say, but I think that the bug I
reported is a POI bug too. If I open an original file with MS Excel 2007 it
works properly, but if I save this file without changes using POI the saved
file not only can't be opened by OpenOffice but also presents problems to be
opened with MS Excel 2007. Excel can open it, but it has to delete some
registers, so I think that exists a problem with Apache POI too.
This is the messages reported by Excel 2007 when I try to open the saved file:
Registros quitados: Información de celda de /xl/worksheets/sheet6.xml parte
Registros quitados: Fórmula de /xl/calcChain.xml parte (Propiedades de
cálculo)
The message is in spanish, in English it could be translated as:
Deleted registers: Cell information of /xl/worksheets/sheet6.xml part
Deleted registers: Formula of /xl/calcChain.xml part (Calculation of
properties)
I can't attach my original file because it contains some private information,
but I will try to modify this file to delete this private information and
attach it. The file is protected so I can't modify it, when I get the password
to unprotect and modify it I will attach the file. Sorry.
J. Miguel
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
DO NOT REPLY [Bug 46419] XSSFWorkbook.wirte() file format error
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46419
Yegor Kozlov <ye...@dinom.ru> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |NEEDINFO
--- Comment #1 from Yegor Kozlov <ye...@dinom.ru> 2008-12-20 05:43:29 PST ---
Please attach the original file.
Yegor
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org