“AIR 2 Excel” Sample App Updated for AIR 2 GA

“AIR 2 Excel” Sample App Updated for AIR 2 GA

I updated the “AIR 2 Excel” sample application for the official AIR 2 launch. “AIR 2 Excel” demonstrates different techniques for AIR/Excel integration, including the new AIR 2 File.openWithDefaultApplication() API.

In Adobe AIR 1.0 and 1.5, there were different options to “open” the data of a Flex DataGrid in Excel. For example, you could leverage the AIR native drag-and-drop support to drag rows from the DataGrid to an open Excel spreadsheet. You could also drag rows to the desktop (or anywhere on the file system) as an .xls file. These two approaches are demonstrated in my Salesbuilder sample application. Another approach was to use a server roundtrip to download the generated .xls file from the server and force Excel to open with the data.

There was however no immediate way to implement a straight (client-side only) “Open in Excel” feature (aka click a button to open your DataGrid data in Excel). With AIR 2.0 and the new File.openWithDefaultApplication() method this becomes extremely easy to implement. In the sample below, I provide an example of this new feature. The sample also supports the drag-and-drop approach from the AIR application to Excel and from the AIR application to the desktop (or anywhere else on the file system). This sample uses the as3xls library to create the Excel spreadsheet. View Source is enabled.

Make sure you have the AIR 2 runtime installed (you can download the AIR 2 runtime here), and install the application using the badge below:

Please upgrade your Flash Player This is the content that would be shown if the user does not have Flash Player 9.0.115 or higher installed.

View Source (right click) is enabled.

NOTE: You can download the AIR 2 SDK here.

  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • LinkedIn
  • StumbleUpon
  • Twitter
This entry was posted in Air, Flex. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

4 Comments

  1. Posted June 17, 2010 at 12:45 pm | Permalink

    Interesting and much needed feature.. ;)

    Thanks for sharing this..

  2. Robert
    Posted June 17, 2010 at 4:58 pm | Permalink

    Looks interesting, thanks for sharing!

  3. Posted June 29, 2010 at 10:02 am | Permalink

    Thanks. I tried and i get this error:
    Source could not be found for flash.filesystem.file…
    can you help any in this regard as i cant find anything on web

  4. Posted August 10, 2010 at 10:22 am | Permalink

    @zahid

    I had the same problem.

    Solution :
    Update your Air SDK to 2.0, and change the line of your xml application description

    Thank Christophe for your great blog !

4 Trackbacks

  1. [...] Christophe Coenraets Rich Internet Applications, Flex, AIR, Java Skip to content BioUsing Flex with Spring « “AIR 2 Excel” Sample App Updated for AIR 2 GA [...]

  2. [...] More here [...]

  3. [...] Direct Link [...]

  4. [...] Exploring the “open with default application” API [...]

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>