all groups > sql server reporting services > may 2007 >
You're in the

sql server reporting services

group:

Check if External Image Url valid/exist


Check if External Image Url valid/exist SL
5/24/2007 10:47:01 AM
sql server reporting services:
Hi,

I would like to check if the external image url is valid, if it is not valid
i would like to show another external "not available" image from an alternate
url. Any idea how do do it or any function that i can use?

i have added a vb function is the custom code to be called to check if the
url is valid, it works great in report designer preview, however after i
deployed, in the report manager all the image return an "not available" image
from an alternate url, regardless if the url is valid.

Below is the VB function that i added into the custom code:

Function IsValid(ByVal Url As String) As Boolean
Dim sStream As IO.Stream
Dim URLReq As Net.HttpWebRequest
Dim URLRes As Net.HttpWebResponse

Try
URLReq = Net.WebRequest.Create(Url)
URLRes = URLReq.GetResponse()
sStream = URLRes.GetResponseStream()
Dim reader As String = New IO.StreamReader(sStream).ReadToEnd()
Return True
Catch ex As Exception
Return False
End Try
RE: Check if External Image Url valid/exist SL
5/24/2007 2:52:01 PM
Please can someone answer my question????? Thanks

[quoted text, click to view]
AddThis Social Bookmark Button