Click here to Skip to main content
15,072,051 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
When i export grid view data to excel the image are not showing..

my export code is below..



HTML
protected void btn_export_Click(object sender, EventArgs e)
    {




        Response.Clear();
        Response.AddHeader("content-disposition", "attachment;filename=FileName.doc");
        Response.Charset = "";
        Response.Cache.SetCacheability(HttpCacheability.NoCache);
        Response.ContentType = "application/vnd.ms-word";
        System.IO.StringWriter stringWrite = new System.IO.StringWriter();
        System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);
        divexport.RenderControl(htmlWrite);
        Response.Write(stringWrite.ToString());
        Response.End();
    }

    public override void VerifyRenderingInServerForm(Control control)
    {
    } 
Posted
Comments
DamithSL 14-May-14 2:16am
   
how you bind divexport? where your images located? update the question with related code
And check below for full tutorial http://www.aspsnippets.com/Articles/Export-GridView-with-Images-to-Word-Excel-and-PDF-Formats-in-ASP.Net.aspx[^]
[no name] 14-May-14 2:27am
   
<div runat="server" id="divexport"><br>
//..gridview cod here....<br>
</div>

I was saw the above link..thats i know already..i use this simple method it show all details expect image..

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

  Print Answers RSS
Top Experts
Last 24hrsThis month



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