W
wubin_98
Hi,
I want to export a gridview data and a image from image control to
export to an Excel document.
When I executed following code, GridView data was exported to Excel
properly. But no image was displayed in Excel. Only a blank image icon
was show inside Excel.
Could any body point out what is wrong in my code or missing anything?
Thanks,
--------------Begin of Code--------------------------------------
Response.Clear()
Dim tw As New System.IO.StringWriter()
Dim hw As New System.Web.UI.HtmlTextWriter(tw)
Dim frm As HtmlForm = New HtmlForm()
Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader("content-disposition",
"attachment;filename=" & "ImageChart.xls")
EnableViewState = False
Controls.Add(frm)
frm.Controls.Add(GridView1)
frm.Controls.Add(Image1)
frm.RenderControl(hw)
Response.Write(tw.ToString())
Response.End()
--------------End of Code--------------------------------------
I want to export a gridview data and a image from image control to
export to an Excel document.
When I executed following code, GridView data was exported to Excel
properly. But no image was displayed in Excel. Only a blank image icon
was show inside Excel.
Could any body point out what is wrong in my code or missing anything?
Thanks,
--------------Begin of Code--------------------------------------
Response.Clear()
Dim tw As New System.IO.StringWriter()
Dim hw As New System.Web.UI.HtmlTextWriter(tw)
Dim frm As HtmlForm = New HtmlForm()
Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader("content-disposition",
"attachment;filename=" & "ImageChart.xls")
EnableViewState = False
Controls.Add(frm)
frm.Controls.Add(GridView1)
frm.Controls.Add(Image1)
frm.RenderControl(hw)
Response.Write(tw.ToString())
Response.End()
--------------End of Code--------------------------------------