views:

34

answers:

1

How to read excel(2007+ xlsx) sheet using actionscript(AIR)?

A: 

Do you have any idea how... Inefficient this is?

Excel uses a complex setup for files, and unless you want to write a full-scale parser for its spreadsheets (which, believe me, will be difficult, alone to figure out what the format chars do), you'd be better off finding another solution.

Say, using a "save to XML" option would make your job a few thousand times easier, without exaggeration. AS3 has no native support for Excel, there is no real point for it to have such. But it has great integrated methods for working with XML.

If possible, save the Excel files to XML and parse those.

Better still, use databases, and parse them as XML through PHP.

I did a search and came up with this: http://code.google.com/p/php-excel-reader/

Once you've got it in PHP, passing it on to Flash is no problem at all. I'd recommend turning it into straight arrays of objects and converting it to AMF3 via Zend_Amf, AMFPHP or WebOrb, whichever one you're most comfortable with. You can then create tables, manipulate the data or whatever you like. It'd also be a lot faster and lighter than using XML.

PK

Pavan