Solved

Access Denied When Rendering a Report Using System.Net.CredentailCache.DefaultCredentials

Posted on 2009-05-19
2
312 Views
Last Modified: 2012-05-07
When I render a report on my local mahcine using the following code - it works correctly and the report is rendered - but with the same code - I'm getting an "401 - Access Denied" on another machine.  What would affet the "System.Net.CredentialCache.DefaultCredentials" so that it worked correctly in one instance but not in another?  

ReportingServices2005.ServerReportOutput output =  new .ReportingServices2005.ServerReportOutput();
 
string reporttype = Request.QueryString["Document"];
string reportname = "ReportName";
       
 output.ReportParameters.Add("ReviewID",Request.QueryString["ReviewID"]);
 output.ReportExecutionUrl = System.Configuration.ConfigurationManager.AppSettings["ReportServer"];
       
output.ReportExecutionCredentials = System.Net.CredentialCache.DefaultCredentials;
output.ReportPath = reportname;
output.OutputType = InfinityIncremented.ReportingServices2005.OutputType.AdobePDF;

thanks in advance for any help with this.
0
Comment
Question by:coecho
2 Comments
 
LVL 11

Assisted Solution

by:Agarici
Agarici earned 250 total points
ID: 24470981
usually you this error when accessing (from your code, with the specified credentials) some file or path which is not accessible to the web server user.
you should try to use only files/paths that are under your application's folder and ensure the folders have the correct credentials set.

you can try using other credentials (some user that you know has access), just to validate the problem.

hth,
A.
0
 

Accepted Solution

by:
coecho earned 0 total points
ID: 24537744
Acutally, it turned out that becuase I had my Web app on a different server, the credentials are not automaticfally being passed to the web server.  By explicitly setting the credentials, I was able to get this working.
0

Featured Post

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

It is helpful to note: This is a cosmetic update and is not required, but should help your reports look better for your boss.  This issue has manifested itself in SSRS version 3.0 is where I have seen this behavior in.  And this behavior is only see…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
The purpose of this video is to demonstrate how to automatically show related posts at the bottom of a blog post in WordPress. This will be demonstrated using a Windows 8 PC. Plugin “Yet Another Related Posts Plugin” will be used. Go to your…
The purpose of this video is to demonstrate how to set up the permalinks on a WordPress Website. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Go t…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question