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
Created attachment 11737 [details] my log4j config file
Created attachment 11738 [details] the source code of my main class that manipulates the xls template
Created attachment 11739 [details] the source code of my main class that manipulates the xls template
Created attachment 11740 [details] my template excel file, no images, no macros!
Created attachment 11741 [details] the binaries of all my own required classes
Created attachment 11742 [details] log4j jar
Created attachment 11743 [details] my modified version of the POI 2.5 release
Created attachment 11744 [details] my modified version of the POI 2.0 release
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!
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.