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.Strin gWriter = New
System.IO.Strin gWriter
Dim htmlWrite As System.Web.UI.H tmlTextWriter = New
HtmlTextWriter( stringWrite)
Dim warnImage As New Image
warnImage = FormView1.FindC ontrol("warnImg ")
Dim path As String = ""
warnImage.Image Url = path
stringWrite.Wri te("<img src=" &
HttpContext.Cur rent.Request.Ur l.GetLeftPart(U riPartial.Autho rity) &
HttpContext.Cur rent.Request.Ap plicationPath & "/" & warnImage.Image Url
& " />")
warnImage.Rende rControl(htmlWr ite)
So I tried tat code and still the image is not shown. No error
whatsoever. I appreciate any help. Thanks in advance.