Solved

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

Posted on 2009-05-19
2
314 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
The purpose of this video is to demonstrate how to create a Printer Friendly PDF on a WordPress Page. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome Screenshot” Google Chrome Extension, and SmallPDF.com Log…
The purpose of this video is to demonstrate how to exclude a particular blog category from the main blog page. This is can be used when a category already has its own tab, or you simply want certain types of posts not to show up on the main blog. …

636 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