Crystal Report Access Denied

  • Thread starter Thread starter Chuck Yeager via DotNetMonster.com
  • Start date Start date
C

Chuck Yeager via DotNetMonster.com

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?
 
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
(e-mail address removed)

-----Original Message-----
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.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) +739CrystalDecisions.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?
 
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
 
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" />
 
Back
Top