hodzung / excellibrary

Automatically exported from code.google.com/p/excellibrary
1 stars 0 forks source link

ContinuedRecord problem #14

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Opening the attached file using workbook.open().
2.
3.

What is the expected output? What do you see instead?

The code throws an exception in the Record.ReadString() method.  So there 
is no output.

What version of the product are you using? On what operating system?

I don't know what version of the product I'm using.  I downloaded my 
current version on 2-13-2009 from 
http://www.codeproject.com/KB/office/ExcelReader.aspx.  

The attached files were created using Excel 2003 on a Win XP system.

Please provide any additional information below.

While attempting to open a file using your product, I sometimes get an 
error.  The error occurs in the Record.cs file, in the ReadString() 
method. Specifically, the error occurs when the code then reads an 
incorrectly large value for the variable "stringlength" (representing the 
length of the string to read), or the variable "size," (representing the 
length of the Asian phonetic settings). This large value is typically 
greater than 10,000 or even 100,000, and creates an exception because that 
many bytes cannot be read into an array.

Through testing, I've found that the error seems to occur when your code 
switches to a continued record using SwitchToContinuedRecord() because the 
end of the current stream has been reached.  The switch to a continued 
record I'm referring to occurs on line 3 of the ReadString() method. I've 
been unable to determine the cause of the error. Maybe its just because 
the file is from Excel 2003. Or maybe its because about 30-35 records end 
up in the "default" case in the Record.Read() method.

Original issue reported on code.google.com by sunilshe...@gmail.com on 18 Feb 2009 at 1:48

Attachments:

GoogleCodeExporter commented 9 years ago
Fixed by r34.

Original comment by China.LiuJunFeng on 18 Feb 2009 at 8:33