hi all,

Im trying to post into an excel file sets of four strings. for 10, 12
records it works fine but after that it gives this exception below. I
searched on the net and updated my POI jar to latest stable release but the
problem is still there.. 

the code looks like this :
        /private static HSSFWorkbook readFile(String filename) throws 
IOException {
                HSSFWorkbook wbook = null;
                
                        try {
                                FileInputStream is= new 
FileInputStream(filename);
                                wbook = new HSSFWorkbook(is);
                                is.close();
                        } catch (RuntimeException e) {
                                
                                e.printStackTrace();
                        }
                
                return wbook;
        }/

the exception is thrown on the line wbook = new HSSFWorkbook(is); . 

[1/21/12 18:16:55:033 AST] 00000029 SystemErr     R
*org.apache.poi.hssf.record.RecordInputStream$Lef
toverDataException: Initialisation of record 0x3C left 5414 bytes remaining
still to be read.
[1/21/12 18:16:55:048 AST] 00000029 SystemErr     R     at
org.apache.poi.hssf.record.RecordInputStream*
.hasNextRecord(RecordInputStream.java:156)
[1/21/12 18:16:55:048 AST] 00000029 SystemErr     R     at
org.apache.poi.hssf.record.RecordFactoryInpu
tStream.nextRecord(RecordFactoryInputStream.java:216)
[1/21/12 18:16:55:048 AST] 00000029 SystemErr     R     at
org.apache.poi.hssf.record.RecordFactory.cre
ateRecords(RecordFactory.java:442)
[1/21/12 18:16:55:048 AST] 00000029 SystemErr     R     at
org.apache.poi.hssf.usermodel.HSSFWorkbook.<
init>(HSSFWorkbook.java:263)
[1/21/12 18:16:55:048 AST] 00000029 SystemErr     R     at
org.apache.poi.hssf.usermodel.HSSFWorkbook.<
init>(HSSFWorkbook.java:188)
[1/21/12 18:16:55:048 AST] 00000029 SystemErr     R     at
org.apache.poi.hssf.usermodel.HSSFWorkbook.<
init>(HSSFWorkbook.java:305)
[1/21/12 18:16:55:048 AST] 00000029 SystemErr     R     at
org.apache.poi.hssf.usermodel.HSSFWorkbook.<
init>(HSSFWorkbook.java:286)
[1/21/12 18:16:55:048 AST] 00000029 SystemErr     R     at
com.ejada.dac.xmlparser.ExcelSheetWriter.rea
dFile(ExcelSheetWriter.java:156)
[1/21/12 18:16:55:048 AST] 00000029 SystemErr     R     at
com.ejada.dac.xmlparser.ExcelSheetWriter.wri
teExcelFile(ExcelSheetWriter.java:100)




I will appreciate if any one can give me a hint as to what I should do to
resolve this. 

When I try to open the xls file that has been created MS Excel says : Excel
Found unreadable content in 'myexcel.xls'. Do you want to  recover the
contents of this workbook? if you click the source of thyis workbook click
yes.  whne i click yes it gives a small box saying : "Repairs to
'myexcel.xls' :Excel recovered your formulas and cell values, but some data
may have been lost.

Thanks in advance.

Syed.

--
View this message in context: 
http://apache-poi.1045710.n5.nabble.com/exception-on-HSSFWorkbook-creation-tp5162898p5162898.html
Sent from the POI - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to