Solved

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

Posted on 2009-05-19
2
309 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This article provides a case study on how our local youth baseball league deployed a new website, including the platform selection, implementation and benefits to the league.
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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 add AdSense Ads to a WordPress Website, and how to set up WordPress to automatically place Ads in Sidebars. This will be demonstrated using a Windows 8 PC. Log into your AdSense account. : Cli…

760 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now