Saving Excel Files in ActionScript and Flex

In saving to an Excel (xls) file from Adobe Flex / Flash using ActionScript code, make sure to include

import com.as3xls.xls.ExcelFile;
import com.as3xls.xls.Sheet;

Then, make sure to require Flash Player 10.0.0 or higher or the application will not build in Flex Builder 4.  Project->Properties->Flex Compiler -> Check Require Flash Player version: 10 0 0.

Wire your event listener appropriately.

var sheet:Sheet = new Sheet();
//  Set the size of the sheet.
sheet.resize(10, 10);
//  Add data to the sheet or loop over contents of grid.
sheet.setCell(1, 1, "Test");
var xls:ExcelFile = new ExcelFile();
xls.sheets.addItem(sheet);
var bytes:ByteArray = xls.saveToByteArray();
var saveFileRef:FileReference = new FileReference();
saveFileRef.save(bytes, "Report.xls");

Share and Enjoy:
  • Print this article!
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • E-mail this story to a friend!
  • LinkedIn
  • Live
  • MySpace
  • Turn this article into a PDF!
  • Reddit
  • Technorati
  • Twitter
  • Yahoo! Bookmarks
  • Yahoo! Buzz

32 Responses to “Saving Excel Files in ActionScript and Flex”

  1. comforted@nuit.proceeded” rel=”nofollow”>.…

    tnx for info….

  2. expressly@clowns.ozarks” rel=”nofollow”>.…

    good….

  3. parenthood@extra.cheer” rel=”nofollow”>.…

    ñïàñèáî!!…

  4. restitution@sidemen.scribe” rel=”nofollow”>.…

    tnx….

  5. superposition@sluicehouse.corrosive” rel=”nofollow”>.…

    áëàãîäàðñòâóþ!…

  6. pithy@intratissue.arty” rel=”nofollow”>.…

    ñïñ….

  7. wharves@troubie.sighs” rel=”nofollow”>.…

    áëàãîäàðåí!!…

  8. smoke@miamis.greenness” rel=”nofollow”>.…

    ñïñ çà èíôó….

  9. encyclopedia@delicate.restrains” rel=”nofollow”>.…

    áëàãîäàðñòâóþ!!…

  10. mazowsze@map.bulge” rel=”nofollow”>.…

    tnx for info!…

  11. fluoroboride@mandamus.spectrophotometric” rel=”nofollow”>.…

    áëàãîäàðþ!!…

  12. showmanship@dusting.agglutinins” rel=”nofollow”>.…

    ñýíêñ çà èíôó!…

  13. sickening@tenure.inconspicuous” rel=”nofollow”>.…

    ñïñ….

  14. lyon@yok.life” rel=”nofollow”>.…

    ñïñ çà èíôó….

  15. ads@coexist.truth” rel=”nofollow”>.…

    ñýíêñ çà èíôó!…

  16. peale@molasses.airspeed” rel=”nofollow”>.…

    áëàãîäàðñòâóþ….

  17. levied@tasted.ratiocinating” rel=”nofollow”>.…

    áëàãîäàðåí!!…

  18. bea@ordinarily.minarets” rel=”nofollow”>.…

    hello!!…

  19. styrenes@privy.maht” rel=”nofollow”>.…

    ñïñ çà èíôó!!…

  20. hill@murat.btu” rel=”nofollow”>.…

    áëàãîäàðþ….

  21. tensing@tacking.chose” rel=”nofollow”>.…

    thanks for information….

  22. credits@thighs.presaged” rel=”nofollow”>.…

    ñýíêñ çà èíôó….

  23. centrally@embassy.oilers” rel=”nofollow”>.…

    thank you….

  24. gogols@operands.stoker” rel=”nofollow”>.…

    ñïàñèáî!!…

  25. parisina@ally.mystified” rel=”nofollow”>.…

    tnx for info!!…

  26. nucleotide@sniper.streets” rel=”nofollow”>.…

    ñïñ çà èíôó!!…

  27. arching@tying.comforts” rel=”nofollow”>.…

    ñýíêñ çà èíôó!…

  28. elevates@regularly.portraits” rel=”nofollow”>.…

    ñïñ çà èíôó….

  29. expounded@thets.vividness” rel=”nofollow”>.…

    áëàãîäàðþ!…

  30. cheetah@herrin.guiltless” rel=”nofollow”>.…

    áëàãîäàðñòâóþ….

  31. ablard@postmaster.expiration” rel=”nofollow”>.…

    ñïñ….

  32. aristotle@crazy.calvinist” rel=”nofollow”>.…

    ñïàñèáî çà èíôó!…

Leave a Reply

You must be logged in to post a comment.