Problem Displaying Image in gridview when exporting to excel and word

asoundmind

Member
Joined
Apr 14, 2007
Messages
6
Programming Experience
Beginner
Hello Guys, I am not sure is this a common problem. I can't display image which in a gridview to excel or word. I have not try on pdf or web but surely this annoy me. I tried to google it and the best I can found is this code which mentioned something tat it is due to excel limitation and so we need to use absolute path. So here is the code, which I modified a bit to match my code. Dim stringWrite As System.IO.StringWriter = New System.IO.StringWriter Dim htmlWrite As System.Web.UI.HtmlTextWriter = New HtmlTextWriter(stringWrite) Dim warnImage As New Image warnImage = FormView1.FindControl("warnImg") Dim path As String = "" warnImage.ImageUrl = path stringWrite.Write("
 & HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority) & HttpContext.Current.Request.ApplicationPath &
") warnImage.RenderControl(htmlWrite) So I tried tat code and still the image is not shown. No error whatsoever. I appreciate any help. Thanks in advance.
 
Last edited:
Back
Top