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

Relative Paths for PictureBox Image giving error

2 Answers 230 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Mike
Top achievements
Rank 1
Mike asked on 29 Jul 2015, 08:15 PM
I am currently trying to take an embedded image out of a report's .resx file and point it (relatively) to a file in an images folder in the same project.  I have tried every combination of the relative path in both Report designer and even setting it in C# in the report's constructor in the code behind.  When I set the pictureBox's value to .\Images\fpi-ontarget-letterhead-black.jpg , it works in design mode, but in preview mode, I get the error: "Invalid URI: The format of the URIcould not be determined."  I noticed that if I set an absolute path on my hard drive, it will work, but I would like to avoid that.  I would like to get it working with a relative path.  Thank you in advance.

2 Answers, 1 is accepted

Sort by
0
Nasko
Telerik team
answered on 30 Jul 2015, 08:22 AM
Hello Mike,

The described issue is a known bug in the Visual Studio Report Designer which will prevent the PictureBox to display the image during Design and Preview of the report. This, however, does not affect run-time or the Standalone Report Designer, so the image will be displayed correctly when you run your application.
Please find attached a sample project demonstrating this behavior.

The bug is logged in our system for improvement and it will be addressed in a future release of the product.
We apologize for any inconvenience it may have caused.

Regards,
Nasko
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Mike
Top achievements
Rank 1
answered on 30 Jul 2015, 05:43 PM
Thank you.  I ended up having to change the image in the Images folder to "Copy if Newer" and Build Action to "Content" to get to see the image, but now it works.
Tags
General Discussions
Asked by
Mike
Top achievements
Rank 1
Answers by
Nasko
Telerik team
Mike
Top achievements
Rank 1
Share this question
or