Click here to Skip to main content
15,890,724 members
Please Sign up or sign in to vote.
3.40/5 (2 votes)
See more:
Hi Developers,

In My web application, my requirement is to export grid view to PowerPoint 2007.

I tried many articles in Google, but there is no successful.

I tried with converting grid view to .bmp image then export to ppt. no success.
In this case,I am loosing the colors of the grid and width of the text inside the grid.

Kindly help me out this issue, this is the major requirement now.
If you know any free third party tools to export kindly let me know.
Posted
Updated 30-Sep-13 20:38pm
v7

Should i assume none of these links worked for you?

Export GridView to Powerpoint in asp.net[^]
 
Share this answer
 
Comments
D-Kishore 27-Sep-13 7:40am    
Except openxml, i tried all the links

Kindly suggest do you have any otherthan this links.
Thanks7872 27-Sep-13 8:08am    
No one would have more links than google. I am sure.
D-Kishore 27-Sep-13 7:42am    
Except openxml, i tried all the links,

Kindly suggest me
put code in button click event

C#
GridView1.AllowPaging = false;   ////////write this code only if paging is enabled.
GridView1.DataBind();////////write this code only if paging is enabled.

Response.Clear();

Response.AddHeader("content-disposition", "attachment;filename=FileName.ppt");///////for text file write FileName.txt

Response.Charset = "";
// If you want the option to open the Excel file without saving than

// comment out the line below
// Response.Cache.SetCacheability(HttpCacheability.NoCache);

Response.ContentType = "application/vnd.ppt";\\\\\for text file write vnd.txt

 

System.IO.StringWriter stringWrite = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htmlWrite =

new HtmlTextWriter(stringWrite);
GridView1.RenderControl(htmlWrite);

Response.Write(stringWrite.ToString());

Response.End();

GridView1.AllowPaging = true; ////////write this code only if paging is enabled.

GridView1.DataBind();////////write this code only if paging is enabled.

 

 

You will have to override function of VerifyRenderingInServerForm like this

public override void VerifyRenderingInServerForm(Control control)
{

///Keep it empty


}



And to avoid exception you have to set property of

HTML
<![CDATA[<%@ Page Language="C#" EnableEventValidation="false" %>
 
Share this answer
 
v2
Comments
D-Kishore 30-Sep-13 22:46pm    
Hi, Thanks for the response

I tried this example,but i am getting empty slide.
Kindly tell me what might be the reason.
dmunisubbu 30-Sep-13 22:49pm    
Yes i am also facing the same issue,

Kindly provide me the solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900