I have an application that uses ASP.NET forms authentication,
I store uploaded images in specific folders on the server which are restricted access with the following code in the web.config.
<location path = "myimages">
<system.web>
<Authorization>
<deny users ="?"/>
<Authorization>
</system.web>
</location>
This works well in the application as the images are only viewable if the user has logged in and is authenticated.
However if I have a Picturebox on a report and try and bind it to one of the images in the restricted folder it fails,
The reports are stored in their own Project within the same solution as the main website.
Is there a way I can authenticate the reports so that I can access the images.
I hope I have explained the issue, but please ask if you need clarification
Thank You
5 Answers, 1 is accepted
Thanks for replying,
I have tried adding the following code as per the link you provided me with, and are still experiencing the same problems:
<
location
path
=
"Telerik.ReportViewer.axd"
>
<
system.web
>
<
authorization
>
<
allow
users
=
"*"
/>
</
authorization
>
</
system.web
>
</
location
>
When I preview a report after binding a picturebox to a field that contains the URL of the image location I still get the following error:
An error has occurred while processing PictureBox 'PictureBox1':
Invalid image data.
------------- InnerException -------------
Parameter is not valid.
However, if I change the database field to point to an image which is not in the protected sub folder, the image displays as expected
So, to clarify, if the database field points to:
www.mywebiste.com/myimages/picture1.jpg it will display an error message
www.mywebsite.com/picture1.jpg it works.
If I paste the image urls into a browser, once logged into the website, both display fine.
i
Please use Fiddler to check the created requests during running the application, also log the whole exception stack trace in the Report.Error event and let us know the result.
You can also test if getting images as illustrated in the User Functions help article resolves the issue.
We will be waiting for your details. Posting the whole report definition and how images are passed to the report will be helpful in resolving the issue.
Regards,
Stef
Telerik
Have you tried the new visualization options in Telerik Reporting Q2 2013? You can get them from your account.