You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Setya <js...@gmail.com> on 2008/02/19 14:03:47 UTC

Exception when parsing excel file

Hi all,

When I try to parse an excel file the POIFSFileSystem throws the following
exception:

java.io.IOException: Unable to read entire block; 167 bytes read before EOF;
expected 512 bytes

	at org.apache.poi.poifs.storage.RawDataBlock.<init>(RawDataBlock.java:78)

	at org.apache.poi.poifs.storage.RawDataBlock.<init>(RawDataBlock.java:50)

	at
org.apache.poi.poifs.storage.RawDataBlockList.<init>(RawDataBlockList.java:52)

	at
org.apache.poi.poifs.filesystem.POIFSFileSystem.<init>(POIFSFileSystem.java:93)

...

Attached is the excel file that I'm trying to parse.

Any help would be greatly appreciated.

Best Regards,

Setya http://www.nabble.com/file/p15560778/Test.xls Test.xls 
-- 
View this message in context: http://www.nabble.com/Exception-when-parsing-excel-file-tp15560778p15560778.html
Sent from the POI - User mailing list archive at Nabble.com.


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


Re: Exception when parsing excel file

Posted by Nick Burch <ni...@torchbox.com>.
On Fri, 22 Feb 2008, Setya wrote:
> Actually the file was produced by Crystal Reports exporting facility. 
> Have you tried opening it with Excel then save it without making any 
> changes ? My friend told me when he did this, the file was parsed 
> without problems.

Looks like crystal reports are outputting corrupt / short stylerecords. 
I've put in a workaround in svn

Nick

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


Re: Exception when parsing excel file

Posted by Setya <js...@gmail.com>.

Nick Burch wrote:
> 
> I've just tried with your file and svn trunk, and I don't get that 
> exception. However, it does blow up with a problem on one of the style 
> records.
> 
> Our code matches the latest microsoft format specification, so I'm not 
> sure what's up with your file. Do you know how it was produced?
> 
> (I've added your file + a disabled test for it to usermodel.TestBugs)
> 
> Nick
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
> 
> 
> 

Hi,

Thank you for trying.

Actually the file was produced by Crystal Reports exporting facility. Have
you tried opening it with Excel  then save it without making any changes ?
My friend told me when he did this, the file was parsed without problems.

Also, I use JExcelAPI to convert it to CSV without problems.

Regards,

Setya
-- 
View this message in context: http://www.nabble.com/Exception-when-parsing-excel-file-tp15560778p15630125.html
Sent from the POI - User mailing list archive at Nabble.com.


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


Re: Exception when parsing excel file

Posted by Nick Burch <ni...@torchbox.com>.
On Tue, 19 Feb 2008, Setya wrote:
> When I try to parse an excel file the POIFSFileSystem throws the 
> following exception:
>
> java.io.IOException: Unable to read entire block; 167 bytes read before EOF;
> expected 512 bytes

I've just tried with your file and svn trunk, and I don't get that 
exception. However, it does blow up with a problem on one of the style 
records.

Our code matches the latest microsoft format specification, so I'm not 
sure what's up with your file. Do you know how it was produced?

(I've added your file + a disabled test for it to usermodel.TestBugs)

Nick

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