poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 44235] New: - Ms Excel can't open save as excel file
Date Tue, 15 Jan 2008 03:14:24 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=44235>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=44235

           Summary: Ms Excel  can't open save as excel file
           Product: POI
           Version: 3.0
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: blocker
          Priority: P2
         Component: HSSF
        AssignedTo: dev@poi.apache.org
        ReportedBy: longsebo@use.com.cn


FileInputStream fIn;
    	HSSFWorkbook workbook ;
    	HSSFSheet sheet;
    	HSSFCell cell;
    	try {
			fIn = new FileInputStream("c://PM0037.xls");
			workbook = new HSSFWorkbook(fIn);
			sheet = workbook.getSheetAt(0);
			cell = sheet.getRow(6).getCell((short)3);
			//cell.setCellValue(1019.2);

	        FileOutputStream fOut = new FileOutputStream("c:/test.xls");
	
	        workbook.write(fOut);
	        fOut.flush();
	        fOut.close();
			 
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
//when use excel 2003 open test.xls is fails,report open fails!need repair.
//when use poi open c:\test.xls report exception:
org.apache.poi.hssf.record.RecordFormatException: Unable to construct record 
instance
	at org.apache.poi.hssf.record.RecordFactory.createRecord
(RecordFactory.java:191)
	at org.apache.poi.hssf.record.RecordFactory.createRecords
(RecordFactory.java:115)
	at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>
(HSSFWorkbook.java:205)
	at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>
(HSSFWorkbook.java:257)
	at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>
(HSSFWorkbook.java:238)
	at plantix.report.poi.TestPOI.testOpenWorkBookComplexStyle
(TestPOI.java:108)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:324)
	at junit.framework.TestCase.runTest(TestCase.java:164)
	at junit.framework.TestCase.runBare(TestCase.java:130)
	at junit.framework.TestResult$1.protect(TestResult.java:106)
	at junit.framework.TestResult.runProtected(TestResult.java:124)
	at junit.framework.TestResult.run(TestResult.java:109)
	at junit.framework.TestCase.run(TestCase.java:120)
	at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run
(JUnit3TestReference.java:130)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run
(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests
(RemoteTestRunner.java:460)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests
(RemoteTestRunner.java:673)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run
(RemoteTestRunner.java:386)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main
(RemoteTestRunner.java:196)
Caused by: java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native 
Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance
(NativeConstructorAccessorImpl.java:39)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance
(DelegatingConstructorAccessorImpl.java:27)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
	at org.apache.poi.hssf.record.RecordFactory.createRecord
(RecordFactory.java:179)
	... 21 more
Caused by: org.apache.poi.hssf.record.RecordFormatException: Expected continue 
record.
	at org.apache.poi.hssf.record.UnicodeString.fillFields
(UnicodeString.java:243)
	at org.apache.poi.hssf.record.UnicodeString.<init>
(UnicodeString.java:117)
	at org.apache.poi.hssf.record.SSTDeserializer.manufactureStrings
(SSTDeserializer.java:49)
	at org.apache.poi.hssf.record.SSTRecord.fillFields(SSTRecord.java:368)
	at org.apache.poi.hssf.record.Record.<init>(Record.java:56)
	at org.apache.poi.hssf.record.SSTRecord.<init>(SSTRecord.java:104)
	... 26 more

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Mime
View raw message