Hi,
I have some content that i have to render as a excel file in browser. I was able to render a grid content to excel with the below code.
Response.Clear();
Response.AddHeader("content-disposition", "attachment;filename=FileName.xls");
Response.Charset = "";
Response.ContentType = "application/vnd.xls";
System.IO.StringWriter stringWrite = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htmlWrite =
new HtmlTextWriter(stringWrite);
GridView1.RenderControl(htmlWrite);
htmlWrite.Write(stringWrite);
Response.Write(stringWrite.ToString());
Response.End();
Now i have to do a similar thing for a image. That is, i want a code that can render a image to excel.
I mean when the user opens the excel he should be able to see the image in it.
Is it possible to convert the image to base64sting format and put it into the excel?
Please let me know if you have any idea similar to this.
Thanks Vinod T.