none
Export DataGrid to Powerpoint presentation RRS feed

  • Question

  • Hello,

    Can any one suggest me on how to export grid view data to Ppt?

    I tried to follow the steps which i found in net but its not working.

    This is what i found in Net.

    Response.ClearContent()
    Response.AddHeader("content-disposition", "attachment;filename=Filename.ppt")
    Response.ContentType = "application/powerpoint"
    Dim sw As New System.IO.StringWriter()
    Dim htw As New System.Web.UI.HtmlTextWriter(sw)
    DataGrid.RenderControl(htw)
    Response.Write(way)
    Response.Write(sw.ToString())
    Response.End()

    Same code works for Word doc and Excel but not for powerpoint

    Thanks for your help in advance.

    Regards,

    Vivek


    • Edited by vivek3352 Tuesday, July 28, 2015 5:15 AM
    Monday, July 27, 2015 10:13 AM

Answers

  • Your issue is about setting MIME in web, So you can refer to link below:MIME Types in IIS.

    Otherwise this forum is about Visual Studio Tools for Office (VSTO), if you want to use VSTO to export datagrid to powerpoint presentation, You can use open xml to create a powerpoint presentation and then manually generate the table using the same data.

    You can click here to refer about How to add a table with rows to PowerPoint using open xml

     

    Tuesday, July 28, 2015 9:29 AM

All replies

  • Your issue is about setting MIME in web, So you can refer to link below:MIME Types in IIS.

    Otherwise this forum is about Visual Studio Tools for Office (VSTO), if you want to use VSTO to export datagrid to powerpoint presentation, You can use open xml to create a powerpoint presentation and then manually generate the table using the same data.

    You can click here to refer about How to add a table with rows to PowerPoint using open xml

     

    Tuesday, July 28, 2015 9:29 AM
  • Hi Vivek

    Powerpoint usually understand image very well.
    Try to render your DataGrid as image.

    You can then make use of somewhat similar code (this is for Excel to Powerpoint) as below:

    Selection.CopyPicture Appearance:=xlScreen, _
            Format:=xlPicture 
    Tuesday, August 4, 2015 3:39 AM