Wednesday, March 07, 2007

Open XML and reports...

Well, I figured I'd geek up my blog a little yet once again. I figure it's good to do every now and again.

So, our reporting system... No not reports as in "how many sales did we have", but the system that allows our customers to deliver final reports to referring physicians. As it turns out, our customers are super duper picky about these things my to my horror... In fact I've just spent the past week working on one of these darn things, and the work shall continue.

You see the problem is, currently we generate these reports by writing custom web pages (and for our faxing system write the same HTML to disk to be faxed by a 3rd party app). And for those of you who don't know, HTML isn't exactly the first format you would choose for publishing. In fact, I'd give it a dead last. It's insanely difficult to do the simple stuff, like get the darn system to page break correctly, automatically for reports that are stored in HTML.

So my idea? Actually, one I stole from my previous employer and improved upon. I'm currently working on a system which will allow our customers to create their very own custom reports inside of Microsoft Word (much better suited for this kind of stuff!). I will create a plugin for word which will add a new "ribbon" (if I've lost you, then you haven't seen Office '07) which will offer customers the ability to add any item to our system that makes sense for these reports.

Using this new docx template, the code I'm working on right now will extract the document file, look for our special tags which tell our system which items to fill into the report, then presto! Our customers get nice looking reports, and our programmers get none of the aggravation that goes into designing then redesigning several times over these darn things!

What makes this all work is the fact that the new word document format (extension docx) is really just a Zip file, inside of this zip file you find a bunch of XML (this is the x), image files that the doc might contain and whatever else. So the task of examining the doc and replacing our markers with good data is dead simple! In fact, I've even found a great Zip library that is licensed under GPL that does *exactly* what I need. If any one was looking for such a thing, you can find it at ICSharp Zip

So fun times playing with new stuff for me :D

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home