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

Passing User Credentials to SSRS

P: 1
Hi, I am trying to check if an image file exists. If it does exist then use it, otherwise, use a default image. I am trying to pass integrated windows login credentials to get a response but I always return false. It seems to not like the credentials. Does anyone have input here? Thanks in advance!

Here is my code:

PS - All this code is done inside the Custom Code of SSRS

Expand|Select|Wrap|Line Numbers
  1. Function IsValid(ByVal Url As String) As Boolean
  2.         Dim URLRes As Net.FileWebResponse
  3.         Dim URLReq As Net.FileWebRequest
  4.         Dim myURI As New Uri("file://www.example.com/" & Url & ".jpg")
  5.         Try
  6.     URLReq = Net.FileWebRequest.Create(myURI)
  7.     URLReq.Credentials = Net.CredentialCache.DefaultCredentials
  8.     URLRes = URLReq.GetResponse()    
  9.     Return True
  10.         Catch ex As Exception
  11.             Return False
  12.         End Try
  13.     End Function
Jun 6 '12 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.