This is a migrated thread and some comments may be shown as answers.

Picture Box Image From URL

4 Answers 1648 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
James Shelton Agar
Top achievements
Rank 2
James Shelton Agar asked on 22 Jan 2009, 11:05 PM
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?

4 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 23 Jan 2009, 12:56 PM
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,
Steve
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Juan
Top achievements
Rank 1
commented on 16 Jan 2022, 07:45 PM

dead link :(
Neli
Telerik team
commented on 19 Jan 2022, 10:31 AM

Hi Juan,

You can check the User Functions article.  If you use the Standalone designer it will be necessary to extend it with the function as explained in the Extending Report Designer article. Note that you may also use an Expression to set the value of the image. For example:

= Condition ? "link when condition is true" : "link when condition is false"

0
richard
Top achievements
Rank 1
answered on 02 Jun 2011, 05:53 PM
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?

Thanks,
Richard
0
Erik
Top achievements
Rank 1
answered on 21 Nov 2011, 03:34 PM
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?
0
Steve
Telerik team
answered on 23 Nov 2011, 05:48 PM
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,
Steve
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!

Tags
General Discussions
Asked by
James Shelton Agar
Top achievements
Rank 2
Answers by
Steve
Telerik team
richard
Top achievements
Rank 1
Erik
Top achievements
Rank 1
Share this question
or