Johnny's Software Saloon

Weblog where I discuss things that really interest me. Things like Java software development, Ruby, Ruby on Rails, Macintosh software, Cocoa, Eclipse IDE, OOP, content management, XML technologies, CSS and XSLT document styling, artificial intelligence, standard document formats, and cool non-computing technologies.

My Photo
Name:
Location: Germantown, Maryland, United States

I like writing software, listening to music (mostly country and rock but a little of everything), walking around outside, reading (when I have the time), relaxing in front of my TV watching my TiVo, playing with my cat, and riding around in my hybrid gas/electric car.

Sunday, August 01, 2004

How to Publish XML Documents in HTML and PDF - and even XLS - using free software!

Lots of people are automating the generation of business reports these days. Reporting has become a buzzword that means just that.

Many departments are dumping a lot of money on very expensive and perhaps not too friendly reporting tools. Many reporting tools assume your want to write lots of code in Java and/or work with a whacky GUI they call a report designer.

I have a feeling you don't want to do either of those things. You just want to get your report assignment written, tested, and deployed so you can move on to other things - like maybe the next one!

These days it is trivial to get Java objects or C# objects into XML format. Once you have done that, it is almost as trivial to get that computer data into a human readable data format. They are both just data. One just needs to be altered a little to make it into the other. Think of it not as recreating the data from one format into another format but rather just helping it out a little so it becomes the other format.

Here is a great introduction to how you can get your feet wet at a simpler way to genrate reports using Cocoon 2.1 It is called How to Publish XML Documents in HTML and PDF.

Of course, being business people or scientists, you just know that a lot of corporate users are going to look at their lovely reports in a spreadsheet like Microsoft Excel or Gnumeric, or the spreadsheet program in Sun's free Open Office enterprise/SOHO software suite.

Using the HSSF Serializer, you can convert your data into GMR XML format that is used directly by Gnumeric, and it will convert it on the fly into the XLS binary format used directly by Microsoft Excel.

So just remember, if you know XML, possibly a little XSLT, and do not mind investing a little time to learn how to set up a Cocoon sitemap.xmap configuration file - then you have have reports coming out quickly, in most formats anyone could ever want.

Personally, I always use Pollo to edit my Cocoon sitemap.xmap files. Pollo is free, easy to use, and does a good job of it. There are plenty of examples included with Cocoon itself and Cocoon's documentation with 2.1 is far better quality and far more complete than it was in the Cocoon 2.0 days.

I am sure that a lot of IT developers and organizations will continue to use these big, powerful, incredibly expensive report generating software packages for years to come. However, I have a pretty good hunch that nearly half of them do not need such packages and would be better served by sitting still long enough to define some XML date formats for their reports, using a convenient API call and some XSLT to get the data in that form, and then massage if needed using a little XSLT or XQuery, and then letting Cocoon translate it into HTML, PDF, XSL, or whatever.

0 Comments:

Post a Comment

<< Home

Related pages & news