Hi,

I have this data in the database and pre-defined template slides on the web server.
What I need to do is to get the data from the database and to create a ppt from the available slides by populating content in them.

Can anyone suggest me how this can be done.

I did made a search on google and found out that you can use COM components to do this in a windows app but not in web.

It also suggested for using Open XML but since I am using .Net 2003 and not 2005, it also poses problems in implementation.

There are third party tools to do this but don't want to do that.
Is there an alternate way to do it ?

Thanks in advance.

couldnt you use VBA in the ppt itself. You can use tcp/ip connections thru VBA. it may be along winded approach but without using a third party tool you may be solving this nightmare for a very long time.

Nope I just can't use a window application approach.
The client specifically needs a web app.

Any other ideas??

i dont see any other way of doing this then than the original open XML approach. Be warned to do something like this will take 100's - 1000's of lines of XML

Yep, I realize that.
Thanks buddy.
Appreciate your help.

Do keep me posted if you find anything else.

Hey Hey.

i managed to get this working. It just simply changes the text inside a bookmark in a word document.

<%@ Page Language="VB" Strict="true" %>
<%@ Import namespace="Microsoft.Office.Interop.Word" %>
<%
    Dim strValue As String = Request.QueryString("value") ' dynamic value to change bookmark text
    
    Response.Clear()
    Response.ContentType = "application/msword" ' Add word header
    
    Dim wordApp As New Microsoft.Office.Interop.Word.Application
    Dim wordDoc As Microsoft.Office.Interop.Word.Document = wordApp.Documents.Add(Server.MapPath("yourname.doc")) ' Load my template word document
    Dim strFTmp As Object = System.IO.Path.GetTempFileName ' Get a temporary filename as cannot stream directly to response.output
    
    wordDoc.Bookmarks.Item("yourName").Range.Text = strValue ' Change bookmark value
    wordDoc.SaveAs(strFTmp) ' Save to temp file
    wordDoc.Close()
    wordDoc = Nothing
    wordApp.Quit(False)
    wordApp = Nothing
    
    Response.WriteFile(CStr(strFTmp)) ' Write file to response stream
    %>

this seemed to work for me. i had some hassle giving the "ASPNET" user account permission to launch the COM object but once you get around that it looks easy enough.

I found this article which forbid using this.
http://support.microsoft.com/?id=257757

What say you ?
Would it be safe to follow the approach you suggested on a development server??

One more thing, I am not sure about the exact tools I need incase I decided to use Open XML. Can you point me in the right direction ?

This is a case of using a safe (ish) third party tool (which after having looked havent found any decent free ones) or being very careful over how you implement it.

Seeing as you did not want to use a 3rd party tool anyway.

ask yourself how often is this feature required and just how much processing is going into. obviously the more processing the higher the risk of it falling over.

for the level of manipulation you want i doubt there is any other way (bar the 3rd party tool route). personally i have only ever manipulated outlook in this way and the results have been fine for me, this was on a clients server with roughly 10 - 20 users at any one time.

and i also missed a vital part out of that code snippet above

System.Runtime.InteropServices.Marshal.ReleaseComObject(wordDoc)
    System.Runtime.InteropServices.Marshal.ReleaseComObject(wordApp)

to free up the com object after use.

As with the open XML approach i may be wrong but i believe office 2007 is a must have for this work e.g. the client will require office 2007 on there machine or the free office 2007 reader to open a document. This may not be a problem in the future but i dont know any of my clients that are currently using the office 2007 suite.

Tools for actually writing open xml aare the simple system.xml classes. This is the reasoning behind openxml so that developers anywhere can maniupluate these standardised documents. I cant seem to find any resources to help im afraid. Just research as much as you can and hope for the best.

Well I believe the users for my application would be around the same level but the usage is going to be typically high (in the figure of 100s of presentations) which I feel is going to definately be a thing to worry about, if I actually opt the COM way.

I guess I just have to take up a third party tool.
I did find this:
http://www.aspose.com/categories/file-format-components/aspose.slides-for-.net-and-java/default.aspx

But don't know if it would suffice and ofcourse its going to cost money.

Thanks anyways.

aspose are usually the best ones i see on the net for any third part tool.

just contact them. tell them what you require and they can say yes or no to whether the solution they offer will fill in all the parts you need.

Seems like a good idea.
Let me try that.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.