Producing Excel reports from Flash

Every new version of Flash comes with a train and a little wagon of nice new features.
Despite all the improvements there are still a few things in Flash technology that aren’t just there, and generating professionally looking printable reports is one of them.  Printing dynamic (data-driven) content from Flash has always been a difficult task. No doubt that the PrintJob class that’s been added to the application API in version 7 has been a huge improvement, yet it hasn’t solved all the problems.
While Flash is very good for printing high resolution graphics (because of its native support for vector graphic format) some tasks that are considered basic in browser environment are very difficult to achieve.

$2.89
- OR -

Overview

Try for example printing a multi-page document from a Flash datagrid component. You will quickly discover that it is simply impossible without doing a lot of extra coding, and even then it will not be 100% reliable.
At the meantime another application such as Microsoft Excel or Word, or even a web browser could do a much better job with no extra time invested. So why don’t we combine the best of the both worlds: use Flash for GUI and a server-side technology for generating printable content in the most suitable format?

In this article we will build a simple Flash interface to be utilized for generating Excel reports.
The reports will be produced without being displayed in the browser and the user will be prompted to save the file to the hard drive. The approach described can be applied when creating multitask portals for generating files in various file formats (ZIP, PDF, DOC, JPEG, etc) for downloading and viewing. 

We will work in Dreamweaver to build the server-side functionality. Although this example is based on PHP/MySQL server model you are by no means limited by the technology. The actual example is fairly basic and will not require hand-coding.
The application we are about to build will function as follows:

  1. User will be presented with a combo box listing genres of available musical records.
  2. User will be able to select a Genre and click the “Generate Report” button.
  3. Clicking the button will call a server-side page which will produce the HTML output.
Without any page refresh the user will be prompted to save the generated Excel spreadsheet to the hard drive.

Alex July

Alex JulyAlex July is a Vancouver-based (Canada, British Columbia) Web Developer/ Graphic Artist who has an extensive experience in both creative realms.
He is also a host of Linecraft.com where he is showcasing his skills and sharing experience with the developers community. For the past 3 years Alex has been focusing on the development of Rich Internet Applications using Macromedia Flash technology.

When away from the computer Alex is practicing Martial Arts, playing guitar and enjoying time with his wonderful family.

See All Postings From Alex July >>

Reviews

Be the first to write a review

You must me logged in to write a review.