Pier Inc Idendity

HTML Reporting in AIR

A How-To on Enterprise HTML Reporting in AIR

Published Sun, Sep 30, 2007 at 6:16 PM

Very early on Pier's foray into Adobe AIR, called Apollo at the time, we encountered the need for client-side reporting. Our initial reaction was, where are the hooks for PDF generation? It was a little surprising to learn that the creation of Adobe's flagship product was not included in the release (nor included in future milestone releases). Even more surprising was the fact that the new Flex HTML control didn't provide printing support. So what's a developer to do? Go back to his/her roots. HTML reporting... Yay!

Here's what you'll need to get started:

A car battery, a set of jumper cables, and a radio antenna... oh no wait, that's how MacGyver destroyed Murdoc's flamethrower.

So to get back on topic, our main goal with our reporting implementation was to maintain a clean designer-developer workflow. Allow the designer to use the toolset they know best with minimal retouching by the developers to get the dynamic content into the HTML. The system also had to be simple to implement for the current project yet extendable to other reporting needs.

Here's what we came up with:

View Template.as

The Template Class is based on the Ruby on Rails templating system. Dynamic variables are inserted into an HTML string by using #{variables_name}. Based off this simple design, you can quickly create complex extensible classes/reports.

In addition to this core templating Class, we also used a CSS framework, Blueprint, which provides a great baseline for our report generation. While HTML reporting is functional, it can be a real beast when you have high design standards as Pier does. Over the next couple weeks we'll cover the way out of HTML reporting hell with an introduction to the Mars PDF format.

Stay Tuned...

Todd Cullen