site site-navbranch.xsl site

Skip to main content.

Looking for PowerPoint and/or Google Analytics solutions? Please follow the above links to

section no_callout.xsl no_callout

page static_html.xsl b2004_11_3

Three-tiered PowerPoint report generator

Articles 4 and 5 demonstrated approaches for generating Excel and PowerPoint reports respectively. They were implemented as WSH scripts which ran on the desktop and made SOAP calls to XML for Analysis. This approach has some attractive features in terms of a users being able to self-support their report generation task. No web server usually means no or less need for IT support. But there are times when having report generation services centrally managed does make sense. So in this article, I demonstrate approaches for developing web applications which perform similar report generation services. My WSH scripts are written in JavaScript - for several reasons. The main reason is that it is a superior language to VBScript and is an ECMA standard. Another benefit (which is largely true for VBScript as well) is that very little code change is required to convert from WSH to ASP and run these scripts under IIS.

As I have mentioned in previous articles, server-side PowerPoint generation is problematic both from the technical and licensing perspective. This presented me with yet another interesting challenge - as I find PowerPoint usually does. And I am pleased to say that I found a solution. I had previously done some experiments with HTA files. These are basically HTML files which run with fewer security restrictions. I found that generating the PowerPoint automation script as an HTA, and sending this to the browser, results in this scripts running properly and automating PowerPoint to build the report. The only trick is to set the ContentType to "application/hta". The PowerPoint templates can be stored server-side and opened from a URL (thank you Microsoft).

I implemented this sample as a two-step user interface. In the first step, the user selects what report they wish to run. A report is comprised of an XML file defining a set of slides (like in previous examples) and metadata about how to connect to the data source. It is a fairly flexible and extensible model but still meant to be a learning tool and not a finished solution. The web pages are build using XSLT.

The user selections in the "question" page are sent to xmla2ppt.asp where they are used as parameters to an XSLT processor which generates PowerPoint automation script. This script is sent back to the browser as an hta where it automates PowerPoint. So I'll say it again - PowerPoint makes a great report writer!

One more note on the download. There is a script named stripslides.wsf in the ppt folder. This script can be used to disassemble a PowerPoint presentation into its component slides (the oposite of the assembly process which this report writer does).

downloads: (148K)