Picture Box Image From URL

5 posts, 0 answers
  1. James Shelton-Agar
    James Shelton-Agar avatar
    108 posts
    Member since:
    May 2008

    Posted 22 Jan 2009 Link to this post

    Hi, I am trying to load an image from external URL, following is my code

    Private Sub detail_ItemDataBound(ByVal sender As System.ObjectByVal e As System.EventArgs) Handles detail.ItemDataBound  
            Dim detail As Telerik.Reporting.Processing.DetailSection = DirectCast(sender, Telerik.Reporting.Processing.DetailSection)  
            Dim section As Processing.DetailSection = TryCast(sender, Processing.DetailSection)  
            Dim row As DataRowView = DirectCast(section.DataItem, DataRowView)  
            Dim aPicBox = DirectCast(detail.ChildElements("pnlDetails").ChildElements("pnlPic").ChildElements("picProperty"), Processing.PictureBox)  
            Dim oWebRequest As WebRequest  
            oWebRequest = WebRequest.Create("http://www.geekologie.com/2007/12/07/future-car-1.jpg")  
            aPicBox.Image = System.Drawing.Image.FromStream(oWebRequest.GetResponse.GetResponseStream())  
        End Sub 

    and I get

    An error has occured while processing PictureBox 'picProperty':
    Access to the path xxxxxxxxx' is denied.

    any suggestions?
  2. Steve
    Steve avatar
    10941 posts

    Posted 23 Jan 2009 Link to this post

    Hi James,

    You can use the value property of the picturebox to set the url directly from the report designer. If you want the image to change based on some condition, the approach is to create a user function that would return
    the proper url and use it instead.

    Best wishes,
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. DevCraft R3 2016 release webinar banner
  4. richard
    richard avatar
    48 posts
    Member since:
    Dec 2010

    Posted 02 Jun 2011 Link to this post

    I am getting this same error when adding images dynamically to 2 subreports on a report in silverlight. the first image looks great but the second gets the "An error has occurred while processing Picturebox xxxxxx. Access to the path <pathname> is denied.

    Why wont it let me access the second image?

  5. Erik
    Erik avatar
    6 posts
    Member since:
    Oct 2011

    Posted 21 Nov 2011 Link to this post

    Steve, was this ever resolved...?

    I am trying to dynamically load an image onto the report from a wbe site. The image is in the server, and the path passes correctly, except when the report tool generates the report, it throws the same error as described above.

    I tried it through a fixed path in my computer, as well as a hosted file on my own IIS server. The former says that the path is unauthorized, the latter throws a 401 error.

    any help?
  6. Steve
    Steve avatar
    10941 posts

    Posted 23 Nov 2011 Link to this post

    Hello Erik,

    This error sounds like a local machine problem.  "Access is denied"  usually refers to permission related problem. Installing Telerik Reporting and running Visual Studio requires administrative privileges, so please log-in as administrator or acquire needed rights. If you're already logged in as Administrator maybe the permissions of the Administrator account are messed up - can you run your application on another machine and verify whether the error persists?

    If it does, please open a support ticket and provide us with a sample project that exhibits the problem and we would advise you accordingly.

    Best wishes,
    the Telerik team

    Q3’11 of Telerik Reporting is available for download. Register for the What's New in Data Tools webinar to see what's new and get a chance to WIN A FREE LICENSE!

Back to Top
DevCraft R3 2016 release webinar banner