Bug 29357 - Code generates unreadable xls files after upgrade to POI_2.5
Summary: Code generates unreadable xls files after upgrade to POI_2.5
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 2.5-FINAL
Hardware: PC All
: P3 critical with 4 votes (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-06-03 10:46 UTC by Tim Wilkins
Modified: 2005-03-20 17:06 UTC (History)
0 users



Attachments
my log4j config file (1.12 KB, text/plain)
2004-06-03 10:56 UTC, Tim Wilkins
Details
the source code of my main class that manipulates the xls template (35.87 KB, text/plain)
2004-06-03 10:57 UTC, Tim Wilkins
Details
the source code of my main class that manipulates the xls template (35.87 KB, text/x-java-source)
2004-06-03 10:59 UTC, Tim Wilkins
Details
my template excel file, no images, no macros! (50.50 KB, application/xls)
2004-06-03 11:00 UTC, Tim Wilkins
Details
the binaries of all my own required classes (28.22 KB, application/java-archive)
2004-06-03 11:01 UTC, Tim Wilkins
Details
log4j jar (344.40 KB, application/java-archive)
2004-06-03 11:02 UTC, Tim Wilkins
Details
my modified version of the POI 2.5 release (797.11 KB, application/java-archive)
2004-06-03 11:05 UTC, Tim Wilkins
Details
my modified version of the POI 2.0 release (631.44 KB, application/java-archive)
2004-06-03 11:07 UTC, Tim Wilkins
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Wilkins 2004-06-03 10:46:20 UTC
I have been writing an Excel file generator that takes a template xls file and
modifies it to insert data. I have successfully been creating xls files working
with the 2.0 release but after I upgraded to the 2.5 release although the code
still executes without error but the xls that is generated can not be read by MS
Excel or Open Office.

I've been talking on the forum about this and various people have mentioned the
 Escher layer but even using templates that do not contain graphics still do not
work.

When I tried to examine the 2.5 generated file with the biff viewer it errored
with the message:

[WARNING] Unknown Ptg 0 (0)
[WARNING] Unknown Ptg 0 (0)
[WARNING] Unknown Ptg 0 (0)
java.lang.NegativeArraySizeException
       at
org.apache.poi.hssf.dev.BiffViewer.createRecords(BiffViewer.java:147)
       at org.apache.poi.hssf.dev.BiffViewer.run(BiffViewer.java:110)
       at org.apache.poi.hssf.dev.BiffViewer.main(BiffViewer.java:693)/

(I get the "[WARNING] Unknown Ptg 0 (0)/" messages with the 2.0 file as well so
I don't think they have anything to with the problem.)


During the development of my code I have had to make a small change to the POI
releases I have used. I'm pretty sure the changes I've made are not relevant to
this problem but for my code to successfully execute it requires my modified
version of the POI API. 

The changes I have made are just to make the following classes implement the
"java.io.Serializable" class:

org.apache.poi.hssf.usermodel.HSSFCell
org.apache.poi.hssf.usermodel.HSSFCellStyle
org.apache.poi.hssf.record.Record 

(I've already submitted a bug report to include these changes in the next
standard release bugzill id 27333)

I'll attach the following files to this bug report:

POI_2.0(tim).jar (my modified version of the POI 2.0 release);
POI_2.5(tim).jar (my modified version of the POI 2.5 release);
CMSExcelGenerator.jar (the binaries of all my own required classes);
ClientPlanGenerator.java (the source code of my main class that manipulates the
xls template);
AllEncompassPlan.xls (my template excel file, no images, no macros!);
ClientPlanGenerator.properties (my log4j config file);
log4j-1.2.8.jar (log4j jar);

Please feel free to contact me if you need any other files (think they are all
you need) or to ask any questions regarding my code.

Many Thanks,

Tim Wilkins
Comment 1 Tim Wilkins 2004-06-03 10:56:50 UTC
Created attachment 11737 [details]
my log4j config file
Comment 2 Tim Wilkins 2004-06-03 10:57:26 UTC
Created attachment 11738 [details]
the source code of my main class that manipulates the xls template
Comment 3 Tim Wilkins 2004-06-03 10:59:39 UTC
Created attachment 11739 [details]
the source code of my main class that manipulates the xls template
Comment 4 Tim Wilkins 2004-06-03 11:00:43 UTC
Created attachment 11740 [details]
my template excel file, no images, no macros!
Comment 5 Tim Wilkins 2004-06-03 11:01:28 UTC
Created attachment 11741 [details]
the binaries of all my own required classes
Comment 6 Tim Wilkins 2004-06-03 11:02:10 UTC
Created attachment 11742 [details]
log4j jar
Comment 7 Tim Wilkins 2004-06-03 11:05:39 UTC
Created attachment 11743 [details]
my modified version of the POI 2.5 release
Comment 8 Tim Wilkins 2004-06-03 11:07:33 UTC
Created attachment 11744 [details]
my modified version of the POI 2.0 release
Comment 9 Tim Wilkins 2004-07-08 10:15:24 UTC
Not sure what code was altered to fix this problem but I just checked out the
REL_2_BRANCH of the 2.5 code and this bug has been fixed. 

Thanks to all who have been bug fixing the 2.5 release! 
Comment 10 Avik Sengupta 2004-07-08 10:19:21 UTC
If you checked out latest CVS on REL_2_BRANCH, yes, certain fixes were applied
to it about two weeks ago for the re-write corruption issue. Thanks for testing
and confirming on this bug.