hdalgrav
hdalgrav

Reputation: 3

Add dynamic data to powerpoint through episerver

I have been asked to help out a client. What he wants to do is create a powerpoint, upload it to the intranet, when someone downloads the powerpoint, add dynamic data from a data source and append to the presentation.

Modifying powerpoint through OpenXML and .NET libraries will be simple enough with some research, even when coming from a PHP/Python background.

The real question I have here is about Episerver. My client runs Episerver for their CMS and I have to be honest that I am not familiar with Episerver at all, and not enough with .NET to know if this is possible. How can i go about setting this up? Can I create a .NET page and have that handle all the logic, running it as a standalone script like I would do in PHP or Python? Do i have to create some sort of plugin for Episerver, or does it act like a normal IIS server?

All answers are greatly appreciated :)

Upvotes: 0

Views: 134

Answers (2)

Sam Plus Plus
Sam Plus Plus

Reputation: 4601

You may want to consider SoftArtisans PowerPointWriter, it was designed for situations just like this. With PowerPointWriter you could have a template file with placeholders in it. When the user request the file you can bind your data from your EPIServer to the template and stream is back to the user with the most up-to-date data. This could work well with the code snippet Andreas posted.

Disclaimer: I work for SoftArtisans.

Upvotes: 1

Andreas
Andreas

Reputation: 1355

What you could do is create a class inheriting from EPiServer.Web.StaticFileHandler and in there do your stuff. I made a Gist with an example here:

https://gist.github.com/anonymous/0f1442c986333f1899ee

Then you go into your web.config and find location-elements that uses EPiServer.Web.StaticFileHandler and replace those with your own class name. There usually is a Global a Documents and a PageFiles location-element in a standard EPiServer site. It depends on the site of course. Any place your client uploads files will need this special StaticFileHandler intercepting requests.

EDIT: Forgot the most important part. The bool return from ProcessRequestInternal means if you handled the request or not. In your case you should use context.Response to write the file to the response and then return true.

Upvotes: 0

Related Questions