Bug 41038 - corrupte output XLS file ( read existing xls then write without modification )
Summary: corrupte output XLS file ( read existing xls then write without modification )
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 3.0-dev
Hardware: PC Windows 2000
: P2 blocker (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on:
Blocks: 42420
  Show dependency tree
Reported: 2006-11-24 07:08 UTC by neuser jp
Modified: 2008-05-08 16:20 UTC (History)
0 users

My input XLS file that occurs problem. (56.00 KB, application/octet-stream)
2006-11-24 07:12 UTC, neuser jp

Note You need to log in before you can comment on or make changes to this bug.
Description neuser jp 2006-11-24 07:08:18 UTC
I'am trying to write to an existing XLS file. For the moment i only open 
existing file then write with POI API.

i use this java code:

in = new BufferedReader(new FileReader(infileName));
POIFSFileSystem fs      =     new POIFSFileSystem(new FileInputStream
SSFWorkbook wb = new HSSFWorkbook(fs,false);
String finalName = outfileName.substring( 0,outfileName.length()-4) 
+ "_out.xls";
FileOutputStream fileOut = new FileOutputStream(finalName);

- This code works well on simple xls file ( 1 cell with hello ) but problems 
appears with my real input xls file. Excell cannot open the output xls file.( 
Excell 2000/Excell viewer 2003 )
- I use the last release and last dev version. same problem.
- while executing, no error, no exception.

I dont known how to attach my XLS input file
Comment 1 neuser jp 2006-11-24 07:12:24 UTC
Created attachment 19169 [details]
My input XLS file that occurs problem.

i found how to attach :)
Problems disappear/appear when suppressing cell M192 but if i let this alone by
copying cell M192 on A1, no problem occurs.
Comment 2 Avik Sengupta 2007-01-16 02:08:19 UTC
Could you try with the latest SVN and check if you problem still appears? Thanks
Comment 3 Yegor Kozlov 2007-04-13 23:51:41 UTC
We still have this bug in the latest RC.

At least I located the problem. 
The attached xls contains MulBlankRecords that result in corruption.
We have read-only support for this record type. When reading, each
MulBlankRecord is converted into a
a set of BlankRecord. When writing back out, the BlankRecords are serialized
instead of the original MulBlankRecord. 
This is the issue.

Comment 4 Josh Micich 2008-05-08 16:20:07 UTC
Retested OK in 3.1-beta1

Bug is reproducible on 2.5.1, but not on 3.0.2.  Comment 3 (2007-04-13) was between those two versions.