I have a pictureBox in my telerik Report.
If i use a real directory "multimedia" the path work , it's ok.
cPath = "~/multimedia//logo.jpg";
But if the directory Multimedia is virtual (cause i shared it for other project)
the report don't find this picture.
i have to use the complete path with domain to get this. "http://localhost/myproject/multimedia/logo.jpg"
And in asp.net Webform , it's work , but in telerik report it doesn"t work.
Have you any solution to give me.
thanks
Oliver
11 Answers, 1 is accepted
this.pictureBox4.Value = @".\images\MyPicture.png";//relative file path
http://www.telerik.com/help/reporting/report-items-picture-box.html
i test this
this.pictureBox4.Value = @".\images\MyPicture.png"
and it's doesn't work for the virtual directory, i don't know why ? cause the server.mappath("~/multimedia/logo.jpg") work very well
Olivier
the last on doesn't work cause the virtual directory isn't present at the root project directory
The only way which works, i don't know why the report telerik work different way webform asp.net
it's :
using System.Drawing;
Image image1 = Image.FromFile(@"C:\MyPictures\MyPicture.jpg");
this.pictureBox1.Value = image1;
Olivier
The issue is fixed in the upcoming internal build. Meanwhile, you can use user function to map the images on the server and set the PictureBox.Value property.
Let us know if you need any further help.
Regards,
Stef
Telerik
Have you tried the new visualization options in Telerik Reporting Q2 2013? You can get them from your account.
Hi Stef, I have a follow up question on your comment regarding "the upcoming internal build".
I updated to Q3 2013 today (30 OCT 2013) and WebForms reports with relative paths in Picture boxes stopped working. The thing that confused me is that the release notes for Q3 2013 states "FIXED: PictureBox does not resolve relative paths to the image". But in my case they were working in Q2 2013 but no longer work in Q3 2013.
The code in the report cs file that was previously working is:
pictureBox1.Value = "/Content/Styles/Images/SchoolLogo.png";
It now throws an error "could not find a part of the path...".
Will the fix you mentioned in the upcoming internal build correct this?
Additionally, where can I find details on the changed functionality that was applied to the PictureBox between Q2 2013 and Q3 2013? I'd like to understand what changed around this space.
Thanks,
Ken
I will implement the user function, it's easy when we inherit from custom telerik reporting class base.
ps : which version correct this bug ?
thanks
Olivier
In general, images are resolved on the server by getting the application root folder and mapping the relative path. This requires a knowledge of the level of the folder in the solution, so you can write a relative path (using dots and slashes) exiting to that level.
The other suggested approach is to utilize user function and programmatically map the images folder.
About the upcoming internal build, we have fixed an issue with relative paths related to specific use in projects. In order to verify if the fix applies to your case, we will need more details about the type of project, the solution structure and the use of the images. Notice the PictureBox.Value set to relative path will be resolved based on the running application root, thus you may not have proper design preview if the image is located in other projects.
Regards,
Stef
Telerik
Have you tried the new visualization options in Telerik Reporting Q2 2013? You can get them from your account.
My MVC 3 solution has a MainProject and it references a ReportProject. The jpg files I want to use in my ReportProject are located in the MainProject in a folder called Images. So how do I reference them in my report picturebox1.value using a Relative Path? I have tried every iteration I could think of (including the examples from Telerik Documentation) and none seem to work.
Our aim is to be able to process images in a consistent way between different platforms. Thus the way we resolve relative paths is to have an unique way of recognizing relative paths by using '.' e.g. "./Images/SomeJPG.jpg". All relative paths are resolved based on the running application folder. This has to be considered while designing your report with the Standalone or VS Designer and displaying it in any Report Viewer. The documentation will be updated respectively with a consecutive release. If you follow this rule and still have issues, try to upgrade to the latest internal build Telerik Reporting Q3 2013 version 7.2.13.1105, where we have fixed an issue with relative paths to images when you use the new Reporting REST service.
If changing the syntax of the image path is not possible, the best solution is to customize the way you set the PictureBox.Value with user function in binding, which allows to you apply any native for the used technology/project type/custom scenario approach to map relative paths.
Let us know if you have any further questions.
Regards,
Stef
Telerik
New HTML5/JS REPORT VIEWER with MOBILE AND TOUCH SUPPORT available in Telerik Reporting Q3 2013! Get the new Reporting version from your account or download a trial.
the last version don't help me to correct the virtual path, but i have inherit all my herit from report base, and i add this custom method 'resolveUrl', it's work very well in this case.
if it's help someone it ll be great.