Click here to Skip to main content
15,886,963 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Please Help me.
I am deploy my asp,net project on web server, and I am using crystal report on my project, If I call for report that time following exception is occurred..


Server Error in '/' Application.
Retrieving the COM class factory for component with CLSID {4DB2E2BB-78E6-4AEA-BEFB-FDAAB610FD1B} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).
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.UnauthorizedAccessException: Retrieving the COM class factory for component with CLSID {4DB2E2BB-78E6-4AEA-BEFB-FDAAB610FD1B} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).

ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6 and IIS 7, and the configured application pool identity on IIS 7.5) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true">, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.

To grant ASP.NET access to a file, right-click the file in File Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.

Source Error:

Line 24: ReportDocument crystalReport = new ReportDocument();
Line 25: crystalReport.Load(Server.MapPath("../Reports/TyreHistoryCard.rpt"));
Line 26: Ds = new DataSet();


Source File: d:\inetpub\vhosts\cuttackstudio.com\suryakiran.biz\Reports\TyreHistoryCardReport.aspx.cs Line: 24

Stack Trace:


[UnauthorizedAccessException: Retrieving the COM class factory for component with CLSID {4DB2E2BB-78E6-4AEA-BEFB-FDAAB610FD1B} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).]
CrystalDecisions.CrystalReports.Engine.ReportDocument..cctor() +298

[TypeInitializationException: The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception.]
CrystalDecisions.CrystalReports.Engine.ReportDocument..ctor() +38
Reports_TyreHistoryCardReport.Page_Load(Object sender, EventArgs e) in d:\inetpub\vhosts\cuttackstudio.com\suryakiran.biz\Reports\TyreHistoryCardReport.aspx.cs:24
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +51
System.Web.UI.Control.OnLoad(EventArgs e) +92
System.Web.UI.Control.LoadRecursive() +54
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +772


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.17929
Posted
Comments
[no name] 8-Oct-14 10:29am    
Try this link:

http://stackoverflow.com/questions/17785063/retrieving-the-com-class-factory-for-component-error-80070005-access-is-de

1 solution

instead of using this type of address in Server.MapPath.
Line 25: crystalReport.Load(Server.MapPath("../Reports/TyreHistoryCard.rpt"));


use this ( ~ ) tild symbol which starts from your Application Directory.
Line 25: crystalReport.Load(Server.MapPath("~/Reports/TyreHistoryCard.rpt"));


IMPORTANT NOTE: crystal report can be easily use on IIS and Visual studio built-in server.
but if you try to use or execute on REAL TIME Web Server then it will obviously give you ERROR, because Crystal Report you using might be Developer Version unless you have Paid for that software.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900