arikdan / as3xls

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

Error : End of file #4

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Run ExcelViewer (http://as3xls.mwudka.com/ExcelViewer/)
2. Load file "file.xls"

What is the expected output? What do you see instead?
An error appears : "ExcelViewer_bug_endoffile.JPG" (Error: Error #2030: Fin
de fichier détectée...)

What version of the product are you using? On what operating system?
Flash Player 9,0,124,0

Please provide any additional information below.
The error appears also when I try to compile the project with Flex builder 3.

Original issue reported on code.google.com by virgi...@concept-image.fr on 15 Oct 2008 at 11:43

Attachments:

GoogleCodeExporter commented 9 years ago
Hi, I've been working a bit with the svn code for the library and I got mine 
working 
by changing the way it reads the records. The problem was its not processing a 
CONTINUE record in the binary data so I added code to process it and now it 
opens it 
fine.

Andrea

Original comment by loquiz...@gmail.com on 29 Jan 2009 at 4:39

GoogleCodeExporter commented 9 years ago
Are you able to give an example of how you fixed this?

Original comment by jo.gibb...@gmail.com on 4 Feb 2009 at 8:00

GoogleCodeExporter commented 9 years ago
here is the library with my changes.

Original comment by loquiz...@gmail.com on 4 Feb 2009 at 8:15

Attachments:

GoogleCodeExporter commented 9 years ago
Any chance of more work being done on this?

Original comment by NoNullPo...@gmail.com on 23 Feb 2009 at 4:33

GoogleCodeExporter commented 9 years ago
I'm having the very same issue and I've tried the modified version of the code, 
but
no luck. Maybe it has something to do with the fact that the Excel file I'm 
trying to
load is 21MB big. Here is the code:

                        var fs:FileStream = new FileStream();
                    try{
                        fs.open(billFile, FileMode.READ);
                        var bytes:ByteArray = new ByteArray();
                        fs.readBytes(bytes);
                        var xls:ExcelFile = new ExcelFile();
                        xls.loadFromByteArray(bytes);
                        trace("sheets:" + xls.sheets.length);
                    } finally{
                        fs.close();
                    }

And I get the following error

Error: Error #2030: End of file was encountered.
    at flash.utils::ByteArray/readUTFBytes()
    at
com.as3xls.xls::ExcelFile/boundsheet()[/Users/sarbogast/dev/labs/as3xls/src/com/
as3xls/xls/ExcelFile.as:649]
    at Function/http://adobe.com/AS3/2006/builtin::call()
    at
com.as3xls.xls::ExcelFile/loadFromByteArray()[/Users/sarbogast/dev/labs/as3xls/s
rc/com/as3xls/xls/ExcelFile.as:313]
    at
billchecker/billsSelected()[/Users/sarbogast/dev/labs/billchecker/src/main/flex/
billchecker.mxml:52]

Original comment by sebastie...@gmail.com on 15 Apr 2009 at 5:54

GoogleCodeExporter commented 9 years ago
did you try the post I added before with the new code? works fine for me after 
the 
changes I mad to it

Original comment by loquiz...@gmail.com on 15 Apr 2009 at 6:33

GoogleCodeExporter commented 9 years ago
Yes, I tried with your version and I get the error above.

Original comment by sebastie...@gmail.com on 15 Apr 2009 at 6:42

GoogleCodeExporter commented 9 years ago
can you post the excel document you are using?

Original comment by loquiz...@gmail.com on 15 Apr 2009 at 6:45

GoogleCodeExporter commented 9 years ago
Do you have an email where I can send you the file? It's not really public data.

Original comment by sebastie...@gmail.com on 15 Apr 2009 at 6:48

GoogleCodeExporter commented 9 years ago
sure loquiz755@gmail.com

Original comment by loquiz...@gmail.com on 15 Apr 2009 at 6:56

GoogleCodeExporter commented 9 years ago
Yea, I was having this problem as well on a sheet that had 7 columns, after 
about 250
rows, I kept getting end of file errors?  From my .NET experience, Excel rows 
can
look completely empty but the sheet rows property can be much larger than the 
actual
rows of data, so so when reading in, I read a row at a time and checked the 
cells
actually had data.  When I found an empty row, I would break.  First I tried
selecting several rows after the last data row and hitting delete.  That use to 
work
in .NET apps but no luck here.

So I tried loquiz's mod and I was able to read my entire test file of about 365 
rows.
 Unfortunately, production files will be on the order of 1000 rows.  Asking for an
example from the users now.

Original comment by tguill...@gmail.com on 27 Apr 2009 at 8:15

GoogleCodeExporter commented 9 years ago
we use it at my office with sheets that have over a thousand records and it 
reads it 
fine, the only thing that might be breaking it its the multiple sheets. I only 
needed 
it to work with one sheet...

Original comment by loquiz...@gmail.com on 27 Apr 2009 at 8:18

GoogleCodeExporter commented 9 years ago
It's EOF error so funny!!. It's working good with ExcelViewer, although there 
is a 
four or five rows of tracing showing the message "Error: Error #2030: Se 
alcanzó el 
final del archivo." (EOF error in English). However, the datagrid was loaded 
without 
the STRINGS values!!!..(column 1). I attached the xls file.

Original comment by cph031...@gmail.com on 1 May 2009 at 5:46

Attachments:

GoogleCodeExporter commented 9 years ago
I can confirm the #2030 EOF error.

Too bad it doesn't work. as3xls would be useful.
Now I have to rely on python or something for xls parsing.

Original comment by michael....@gmail.com on 18 Jun 2009 at 10:59

GoogleCodeExporter commented 9 years ago
Got same problem, please fix, its priority should be higher.

Original comment by neog...@gmail.com on 22 Jul 2009 at 6:42

GoogleCodeExporter commented 9 years ago
loquiz's (Andrea) fix has been working fine for me on Excel files of about 1000 
rows.
 That fix needs to be incorporated into the trunk if it has not already.  The change
is posted in comment 3.  This is a very useful lib, the kind of thing you'd 
expect to
become part of the Flex framework.

Original comment by tguill...@gmail.com on 22 Jul 2009 at 3:59

GoogleCodeExporter commented 9 years ago
I fixed using the loquiz version, but i found another problem: in Mac 
environment If i load a file using a stream 
in Adobe Air the stream is Big_Endian, i create a bytearray using that data, 
setting the endian property to the 
same of stream (so Big_Endian) but when i pass to the Excel class this 
bytearray is converted under the hoods to 
Little_Endian and the class doesn't detect any sheet.

Any solution?

Original comment by neog...@gmail.com on 22 Jul 2009 at 7:35

GoogleCodeExporter commented 9 years ago
Hi guys

I try work with the version of loquiz755, But the error "Error #2030: End of 
file was
encountered. at flash.utils::ByteArray/readUTFBytes() " still happen.

I attached the xls file that I use.

Please let me know, how I can fix that. Thanks 

Original comment by vhredo...@gmail.com on 12 Aug 2009 at 5:11

Attachments:

GoogleCodeExporter commented 9 years ago
Try to o a full clean of the project to force a reload of the lib.

Original comment by neog...@gmail.com on 12 Aug 2009 at 5:18

GoogleCodeExporter commented 9 years ago
I try with the full clean, but dont work, still happen the error

Original comment by vhredo...@gmail.com on 12 Aug 2009 at 5:40

GoogleCodeExporter commented 9 years ago
the fix i did doesnt seem to work with anything that is very large. since I only
needed it for small files I didn't encounter that problem...I am on vacation 
right
now so I can't really look at it but it should be a simple thing to fix if you 
just
look at the code.

Original comment by loquiz...@gmail.com on 12 Aug 2009 at 10:56

GoogleCodeExporter commented 9 years ago
Ok. I think so that I will decompose the gib xls, in xls more light

Thanks yours comments guys.

Original comment by vhredo...@gmail.com on 13 Aug 2009 at 4:06

GoogleCodeExporter commented 9 years ago
I found that the 'format' function in ExcelFile.as was incorrectly implemented, 
leading to the #2030 EOF Error.

Since this project seems unmaintained, I've implemented the change over on 
GitHub:

http://github.com/djw/as3xls/

My version now treats the FORMAT record according to the definition on p174 of 
http://sc.openoffice.org/excelfileformat.pdf .

The two excel files attached to this ticket now parse without problems.

Original comment by danjwilson on 6 Sep 2009 at 3:31

GoogleCodeExporter commented 9 years ago
Thanks so much for that Dan!  Your fixed as3xls works like a champ!

Original comment by TheTay...@gmail.com on 2 Nov 2009 at 7:22

GoogleCodeExporter commented 9 years ago
I realized that when you modify a file with Microsoft office 2007 you have this 
problem.

I tried to use dan's lib but I have an encoding problem with the headers of my 
Excel
sheets. Any idea what is the problem?

Thanks

Original comment by fadi.man...@gmail.com on 17 Nov 2009 at 8:19

GoogleCodeExporter commented 9 years ago
Hi all,

I am new to the flex, It would be great help if anyone has the solution for the 
error
which I am getting frequently. Sometimes whenever import the excel file which 
has
more than 350 rows it is throwing below error. Sometimes if I load excel sheet 
which
has more than 350(even more than 1500)it is working fine. Please help me on 
this.
Error: Error #2030: End of file was encountered.
    at flash.utils::ByteArray/readUTFBytes()
    at com.as3xls.xls::ExcelFile/format()[/Users/manuelwudka-robles/Documents/Flex
Builder 3/as3xls/com/as3xls/xls/ExcelFile.as:712]
    at Function/http://adobe.com/AS3/2006/builtin::call()
    at
com.as3xls.xls::ExcelFile/loadFromByteArray()[/Users/manuelwudka-robles/Document
s/Flex Builder
3/as3xls/com/as3xls/xls/ExcelFile.as:309]

Original comment by veer.di...@gmail.com on 28 Mar 2010 at 12:13

GoogleCodeExporter commented 9 years ago
Try with 2.0 MB xls file.. you get this error..

Error #1502: A script has executed for longer than the default timeout period 
of 15 seconds.

Original comment by rakesh.c...@gmail.com on 20 Jan 2011 at 5:45

GoogleCodeExporter commented 9 years ago
Hi Dan/ loquiz..Please help me out with xls file size greater than 2.0 MB..

I get the time out error..

Error #1502: A script has executed for longer than the default timeout period 
of 15 seconds.

Original comment by rakesh.c...@gmail.com on 20 Jan 2011 at 6:23

GoogleCodeExporter commented 9 years ago
Hi Loquiz, I am also facing the same "End of File" issue. When I opened the zip 
file that you have attached namely "as3xls.zip", there is no .swc file, but a 
folder with name "as3xls-1.0.swc". How do I get the actual .swc file and how do 
I put that in the library of my flex project. Please let me know.

Thank You very much.

Original comment by srinivas...@gmail.com on 5 May 2011 at 12:15

GoogleCodeExporter commented 9 years ago
Hello from Colombia!
I had the same issue. I downloaded the source code and i edited the 
"loadFromByteArray(xls:ByteArray)" method, i added a try-catch block code in 
the while cicle.
I don't know becouse it happend. But this try and catch solves the issue.

:)

Now the method is:
public function loadFromByteArray(xls:ByteArray):void {
// Newer workbooks are actually cdf files which must be extracted
   if(CDFReader.isCDFFile(xls)) {
      var cdf:CDFReader = new CDFReader(xls);
      xls = cdf.loadDirectoryEntry(0);
   }

   br = new BIFFReader(xls);

   var unknown:Array = [];
   var r:Record;

   while((r = br.readTag()) != null) {
   try{
    if(ignore.indexOf(r.type) != -1) {
        continue;
    }

    if(r.type != Type.CONTINUE) {
        lastRecordType = r.type;
    }

    if(handlers[r.type] is Function) {
        (handlers[r.type] as Function).call(this, r, currentSheet);
    } else {
        unknown.push(r.type);
    }
   }catch(e:Error){
    //Alert.show("Error cargando desde byte array. "+e.message);
   }

   }

   if(unknown.length > 0) {
        //throw new Error("Unsupported BIFF records: " + unknown.join(", "));
   }
}

Original comment by diana.ce...@seratic.com on 11 Aug 2011 at 8:52

GoogleCodeExporter commented 9 years ago
Please update the source code in the downloads.

Original comment by timothyr...@gmail.com on 9 Jul 2013 at 11:59

GoogleCodeExporter commented 9 years ago
Hi dudes!

I used the advice from our colombian friend, and the error is gone, I attach 
the final library!

love from Mexico!

Original comment by cs.dr...@gmail.com on 21 Oct 2014 at 12:00

Attachments: