Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / June 2007

Tip: Looking for answers? Try searching our database.

Crystal Report Access Denied

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Chuck Yeager - 07 Apr 2005 21:34 GMT
I think I am giong to die, this is driving us nuts.

Here is the error we are getting when trying to use CrystalReportViewer:

OS: XP SP1 and another machine XP SP2 (same errors)
IDE: VS .NET 2003

ERROR MESSAGE
-----------------------------------
Access is denied.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Runtime.InteropServices.COMException: Access is
denied.

Source File: C:\Inetpub\wwwroot\homie\ar15.aspx.cs    Line: 30

Stack Trace:

[COMException (0x80004005): Access is denied.
]
  CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.Open
(Object& DocumentPath, Int32 Options) +0
  CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.Open
(Object& DocumentPath, Int32 Options) +72
  CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened
() +218

[Exception: Load report failed.]
  CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened
() +269
  CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String
filename, OpenReportMethod openMethod, Int16 parentJob) +739
  CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String
filename) +52
  Homie.mbrCrystalReport.Page_Load(Object sender, EventArgs e) in c:\
Inetpub\wwwroot\homie\ar15.aspx.cs:30
  System.Web.UI.Control.OnLoad(EventArgs e) +67
  System.Web.UI.Control.LoadRecursive() +35
  System.Web.UI.Page.ProcessRequestMain() +750



------------------------------------

ERROR CODE
------------------------------------
CrystalDecisions.CrystalReports.Engine.ReportDocument crReportDocument =
new CrystalDecisions.CrystalReports.Engine.ReportDocument();
            crReportDocument.Load(@"C:\Inetpub\wwwroot\homie\ar15.rpt");
-------------------------------------

We have tried the temp directory permissions with the ASPNET account option
and it did not work.

What is going on, anyone outhere know?
Steve C. Orr [MVP, MCSD] - 07 Apr 2005 21:46 GMT
As a test, you can use impersonation to have ASP.NET run under a different
user account.  (Perhaps your user account since you know you have the
necessary permissions.)

For example, you can add a line similar to this to your web.config file:
<identity impersonate="true" userName="domain\MyUserName">
password="password"/>

Here's more info on impersonation:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cp
conaspnetimpersonation.asp


Signature

I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net

>I think I am giong to die, this is driving us nuts.
>
[quoted text clipped - 56 lines]
>
> What is going on, anyone outhere know?
Elton Wang - 07 Apr 2005 21:54 GMT
Hi Chuck,

When a CR is being created in ASP.NET, the .NET will
create a report file in a temp folder, e.g. C:\Documents
and Settings\UserName\ASPNET\Local Settings\Temp. You can
try to give ASPNET permission for this folder.

HTH

Elton Wang
elton_wang@hotmail.com

>-----Original Message-----
>I think I am giong to die, this is driving us nuts.
[quoted text clipped - 21 lines]
>]
>  
CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocu
mentClass.Open
>(Object& DocumentPath, Int32 Options) +0
>  
CrystalDecisions.ReportAppServer.ReportClientDocumentWrappe
r.Open
>(Object& DocumentPath, Int32 Options) +72
>  
CrystalDecisions.ReportAppServer.ReportClientDocumentWrappe
r.EnsureDocumentIsOpened
>() +218
>
>[Exception: Load report failed.]
>  
CrystalDecisions.ReportAppServer.ReportClientDocumentWrappe
r.EnsureDocumentIsOpened
>() +269
>  
CrystalDecisions.CrystalReports.Engine.ReportDocument.Load
(String
>filename, OpenReportMethod openMethod, Int16 parentJob) +739
>  
CrystalDecisions.CrystalReports.Engine.ReportDocument.Load
(String
>filename) +52
>   Homie.mbrCrystalReport.Page_Load(Object sender, EventArgs e) in c:\
[quoted text clipped - 16 lines]
>
>What is going on, anyone outhere know?
Chuck Yeager - 07 Apr 2005 22:25 GMT
Thanks for your feedback gentlemen,

Steve,

I have tried Steve's option and the error is gone, but I do not want to
hard code the username and password.

Elton,

I have tried that and access denied still occurs.  

I will probably stumble accross the answer while sitting on the pot tonight
just before I go to bed. :)

But, just in case any other ideas would be greatly appreciated
Steve C. Orr [MVP, MCSD] - 07 Apr 2005 22:51 GMT
Putting values in a web.config is not the same as hardcoding.
Web.Config values can be easily changed at any time without recompiling.

However, if you're determined to find another solution I'd suggest you start
by searching the Crystal Reports knowledge base:
http://support.businessobjects.com/search/results.asp?summary=1&ct=livewww-all&o
utput=xml_no_dtd&filter=0&radioGroup=kbase_search&q=Access+is+denied&content_typ
=all_support&btnG=Search&language=EN&index_cont=0&index_ftyp=0&index_lang=0&inde
x_ver=&index_lang=&indexq2=&indexq3=&indexq4
=

Signature

I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net

> Thanks for your feedback gentlemen,
>
[quoted text clipped - 12 lines]
>
> But, just in case any other ideas would be greatly appreciated
Chuck Yeager - 07 Apr 2005 23:01 GMT
Thanks Steve!

I will look at that
Chuck Yeager - 11 Apr 2005 14:32 GMT
I put in the web config the following and it works like a charm!

   <authentication mode="Windows" />
   
   <identity impersonate="true"  userName="domainname\username"
password="mypassword" />
jmnobre - 08 Jun 2007 10:27 GMT
>I put in the web config the following and it works like a charm!
>
>    <authentication mode="Windows" />
>    
>    <identity impersonate="true"  userName="domainname\username"
>password="mypassword" />

Ok... I had exactly the same problem... I was impersonating a different user,
and the CR did not load the report....
I follow some tips from this forum, and then i find out something AMAZING!
I'm impersonating the user X, but still, CR is trying to create the temp
report on the temp directory of ASPNET user!!! :))))

So... i just grant full access to my X user on the ASPNET temp directory, and
guess what? It's solved! :)

Hope this helps!

jmn

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.