Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I want to export data in to excel from grid. My grid contains image.
Am using the following code,
private void CreateXL()
   {

       Response.Clear();
       Response.AddHeader("content-disposition", "attachment;filename=xxxxxxxt.xls");
       Response.Charset = "";



       Response.ContentType = "application/vnd.xls";
       StringWriter objStringWriter = new StringWriter();
       HtmlTextWriter objHtmlTextWriter = new HtmlTextWriter(objStringWriter);

       Gridview.RenderControl(objHtmlTextWriter);
       Response.Write(objStringWriter.ToString());
       Response.End();
   }


But in excel am not able to see the images, instead of image am getting message that,
'The linked image cannot be displayed> The file may have been moved,renamed or deleted.Verify the links points to the correct file and location.

How can i solve this problem?
Posted
Updated 13-Mar-13 4:23am
v2
Comments
Am Gayathri 13-Mar-13 9:33am    
please help

1 solution

Hi Kavitha,

I think the below link will solve your problem. Take a look into that.

http://www.aspsnippets.com/Articles/Export-GridView-with-Images-to-Word-Excel-and-PDF-Formats-in-ASP.Net.aspx[^]

Regards,
Manoj
 
Share this answer
 

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