site site-navbranch.xsl site
section no_callout.xsl no_callout
page static_html.xsl b2003_4_12
In this article, I will demonstrate the generation of PowerPoint presentations from OLAP data. While more complex that the samples presented thus far, it is also the most powerful in terms of delivering reporting value. The generated reports will support charts, graphs, and tables. The PowerPoint file sample.ppt is an example of a report generated by the XML file in this article.
Using the declarative analytics framework I have demonstrated, you can quickly assemble new reports as needed. The reports are stand-alone and so can be emailed or presented before an audience. Finally, you have the capability to add "spit and polish" using the PowerPoint program before publishing the final report.
To understand PowerPoint generation, I refer you back to Article 1, in which I demonstrated a WSH script to generate a PowerPoint chart. As I had stated then, PowerPoint doesn't currently have any XML or other textual save format. So to generate a PowerPoint presentation we are stuck with making OLE Automation calls. But if you look at my original PowerPoint example, you see repeated patterns of code. The breakthrough in solving the PowerPoint creation task was the realization that the PowerPoint automation program is itself a text file. And XSLT can easily create such text files.
The readme file included with the source explains the purpose of the various files in this sample. The main script file is xmla2ppt.wsh. The basic operation of the script is to a) iterate a query manifest file, b) run each query, c) accumulate the results into an XML file, d) transform this file into an automation script, and e) execute the generated script.
After executing the child script I delete the generated script. Basically these generate scripts work by opening a PowerPoint presentation "template" and then copying slides from this template and then populating data into the objects on this slide. To use this approach in PowerPoint, you need to name the objects on your slide templates, and have a title which identifies the template. A comment header in the program has two PowerPoint macros I use to accomplish these tasks.
Because this process uses Automation, during execution you actually see PowerPoint build the presentation slide by slide. Some people consider this a nice feature. I liken it to a player piano. Of course I would prefer for there to be an XML file format for PowerPoint which I could generate directly with XSLT. But it is not clear that such a thing will be available, even in Office 2003 (update: it is not).
downloads: xmla2ppt.zip (116K)