By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,057 Members | 1,249 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,057 IT Pros & Developers. It's quick & easy.

Image export

P: n/a
In this popular code to extract to Excel from Datagrid, canybody tell
me how to export an Image along with the remaining text.

Thanks
K
Response.Clear();

Response.AddHeader("content-disposition",
"attachment;filename=FileName.xls");

Response.Charset = "";

// Comment out the line below
// Response.Cache.SetCacheability(HttpCacheability.No Cache);

Response.ContentType = "application/vnd.xls";

System.IO.StringWriter stringWrite = new System.IO.StringWriter();

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

myDataGrid.RenderControl(htmlWrite);

Response.Write(stringWrite.ToString());

Response.End();

Oct 2 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.