yixiaohui12345 / as3xls

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

Does not parse files from OSX #3

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Upload an excel file (created on mac or win) from either safari or firefox
2.
3.

What is the expected output? What do you see instead?
Expect to see the file contents, with worksheet info, but nothing is displayed. 
  Same files on 
windows loads just fine.

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

Please provide any additional information below.

Original issue reported on code.google.com by scott.sh...@gmail.com on 12 Aug 2008 at 5:26

Attachments:

GoogleCodeExporter commented 9 years ago
I experience the same behaviour

Original comment by pieter.m...@gmail.com on 27 Aug 2008 at 7:05

GoogleCodeExporter commented 9 years ago
Have to second that

Original comment by andrew.m...@gmail.com on 18 Oct 2008 at 6:54

GoogleCodeExporter commented 9 years ago
i have that problem...

Original comment by fark...@gmail.com on 22 Oct 2008 at 10:27

GoogleCodeExporter commented 9 years ago
Hi guys.

I'm a developer too and figured out a solution to your problem.
It seems that the roundtrip.php is causing the problem on usage on mac.

Using flash 10 and the flex 4 SDK, you can use the new FileReference class and 
this
will solve your problem with uploading.
This will solve the problem and is even more easy to implement.

file:FileReference
with the new class you can just us file.load instead of the file.upload as in 
the
example form the creator of this package.

Base64 encoding isn't needed anymore too just load from file:
xls.loadFromByteArray(file.data) 

Anyway just wanted too share this information and goodluck!
If needed I can upload a file with the example rewritten for flash 10 and flex 
4 SDK.
Just let me know

Season greetings,

Danny
iM3D

Original comment by im3d.and...@gmail.com on 17 Dec 2008 at 3:22

GoogleCodeExporter commented 9 years ago
hey, if you could upload a sample, that would be great! :)

Original comment by pieter.m...@gmail.com on 17 Dec 2008 at 3:32

GoogleCodeExporter commented 9 years ago
Hi

I've used the example file from the excelViewer from Sigfrid3141 and made a few
changes too explain my solution.

This should do the trick. So you need the flex SDK 4 and change the compiler 
settings
from your project to use the flex sdk 4 and also change the html-wrapper to 
flash
player 10. More info on using the flex 4 sdk: 
http://blog.flexexamples.com/2008/08/02/using-the-beta-gumbo-sdk-in-flex-builder
-3/

Hopefully this will do trick for you mac owners. My collegue uses a mac and 
confirmed
my solution, but hasn't been checked by many other mac users.

Another thing the new FileReference will also allow your to save an excellsheet
within a normal flex application. Due to security issues  with the previous 
flash
player this wasn't possible, only within an Adobe air application.
Hence the Adobe air example CSV2XLS application from Sigfrid3141.

goodluck!

Original comment by im3d.and...@gmail.com on 17 Dec 2008 at 8:21

Attachments:

GoogleCodeExporter commented 9 years ago
correction flex sdk4 isn't needed, just flash player 10

Original comment by im3d.and...@gmail.com on 18 Dec 2008 at 10:55

GoogleCodeExporter commented 9 years ago
hi all,
  i am using the solution described by im3d.android (with Flex 4 and Flash Player 10)
to leverage file.load, instead of file.upload.  However, I can only open certain
spreadsheets.  The xls files linked on the project's homepage work, along with 
some
that i have saved off in my documents folder.  If I create any new spreadsheets 
(or
edit one that already works) in either Mac Excel 2004 or Windows Excel 2003, the
ExcelFile object fails to load the bytearray.
  the flex application is running on a windows 2003 machine, i have tried this upload
thru ff or safari.  has anyone found a definitive way to know what will or will 
not
load correctly?

Original comment by rosow...@gmail.com on 12 Jan 2009 at 2:03

GoogleCodeExporter commented 9 years ago
Hi,

Be sure that you are saving as excel97-2003. Make use of try-catch statements 
to get
rid off those annoying flash player error notifications.
My experience with excel files is not to use cel-formatting, that gave me too 
much
problems, keep the excel files as basic as possible. Even formulas as basic as 
sum or
reference cells, gave me troubles.
So is I suggest to use excel files only with static text information. Or 
program to
handle with these sort of information and exceptions, but you have to do this 
yourself.
Try creating a basic excel-file that is empty and start filling more 
information, to
see where things go wrong.

Original comment by im3d.and...@gmail.com on 15 Jan 2009 at 10:25

GoogleCodeExporter commented 9 years ago
I found for myself that I had to save the spreadsheet out as Excel 95 format to 
get
it to work. I can confirm that the latest Flex 3 sdk, and setting the required 
flash
player to 10.0.0 works on a Mac.

Original comment by ibr...@gmail.com on 16 Apr 2009 at 10:50

GoogleCodeExporter commented 9 years ago
It seems to work well with files I create or the file you posted here. Of course
doesn't work with the client file :S
I get:
Error: Error #2030: End of file was encountered.
    at flash.utils::ByteArray/readUnsignedShort()

I tried converting the files in any format but doesn't seem to help.

Original comment by nuthink...@gmail.com on 19 May 2009 at 9:50

GoogleCodeExporter commented 9 years ago
Hi All,

I'm running OSX and encountered the same problem.

On Alex Ott's blog I found this link to the excel file spec:
http://download.microsoft.com/download/0/B/E/0BE8BDD7-E5E8-422A-ABFD-4342ED7AD88
6/Excel97-2007BinaryFileFormat%28xls%29Specification.pdf

The parsing goes wrong on a FORMAT Record (see page 122 of spec for 
description).
Somehow the parser reads a data length for the UTF String to read that is 
actually
larger than the Record data length.
I've changed now locally ExcelFile.as -> format() and the parsing goes well.

private function format(r:Record, s:Sheet):void {
    if(version == BIFFVersion.BIFF4 || version == BIFFVersion.BIFF5) {
        r.data.position += 2;
    }

    var len:uint = r.data.readUnsignedByte();
    if(len > r.data.length - r.data.position)
        return;
    var ss:String = r.data.readUTFBytes(len);
    if(s is Sheet) {
        s.formats.push(ss);
    } else {
        globalFormats.push(ss);
    }
}

Original comment by droomle...@gmail.com on 11 Oct 2009 at 12:02

GoogleCodeExporter commented 9 years ago
Hi All,

I've fixed this bug, along with a bunch of others, in my fork at:

http://github.com/djw/as3xls

(I mentioned this in ticket #4 but not here, sorry!)

The fix is slightly more involved than version given above, take a look at my 
patch here:

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

Original comment by danjwilson on 29 Oct 2009 at 4:04

GoogleCodeExporter commented 9 years ago
I had the same issue. 

I went to GitHub and downloaded the source to compile it into my project as
danjwilson suggested. Works great on OSX now, no more exceptions.

Original comment by matt.rap...@gmail.com on 22 Mar 2010 at 6:44