You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2008/01/15 04:14:24 UTC

DO NOT REPLY [Bug 44235] New: - Ms Excel can't open save as excel file

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


DO NOT REPLY [Bug 44235] - Ms Excel can't open save as excel file

Posted by bu...@apache.org.
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





------- Additional Comments From longsebo@use.com.cn  2008-01-14 19:15 -------
Created an attachment (id=21394)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=21394&action=view)
well format excel 


-- 
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


DO NOT REPLY [Bug 44235] - Ms Excel can't open save as excel file

Posted by bu...@apache.org.
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


yegor@dinom.ru changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|blocker                     |major




------- Additional Comments From yegor@dinom.ru  2008-01-15 00:34 -------
Thanks for the bug report. 
Looks like something is wrong with the serialization of unicode strings. 
If I change all fonts to Arial the test passes but it fails with the original
(Chinese) fonts. 
The code responsible for serialization of strings is quite complicated
(SSTRecord and related classes). SO, it will take some time to fix. 

Yegor

-- 
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