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

Forms authentication problem with ASP.NET Reporting

5 Answers 124 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
lynd wil
Top achievements
Rank 1
lynd wil asked on 23 Aug 2013, 06:34 PM
Hi
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

Sort by
0
Squall
Top achievements
Rank 1
answered on 28 Aug 2013, 04:54 PM
0
lynd wil
Top achievements
Rank 1
answered on 30 Aug 2013, 09:56 AM

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

 

 

 

0
Squall
Top achievements
Rank 1
answered on 03 Sep 2013, 12:52 PM
Do you get the same error if you hardcode the url as PictureBox.Value?
0
lynd wil
Top achievements
Rank 1
answered on 03 Sep 2013, 07:26 PM
Hi squall Yes, did try that with the same results
0
Stef
Telerik team
answered on 06 Sep 2013, 04:50 PM
Hello,

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.

Tags
General Discussions
Asked by
lynd wil
Top achievements
Rank 1
Answers by
Squall
Top achievements
Rank 1
lynd wil
Top achievements
Rank 1
Stef
Telerik team
Share this question
or