cancel
Showing results for 
Search instead for 
Did you mean: 

System.Runtime.InteropServices.COMException: Access denied

Former Member
0 Kudos

Hallo,

I am having a web service, which creates an rpt file. When I am running my project through .Net Studio all are working perfect. When I try to call my web service through Internet Explorer, I am taking the following error

CrystalDecisions.Shared.CrystalReportsException: Could not load report

System.Runtime.InteropServices.COMException: Access denied

I have spent a Week trying to figure out what the Problem is. Can someone help me?

Microsoft Visual Studio 2008

.Net Framework 3.5 SP1

Windows 7

That is my Code; I think the Problem appears when method ExportTostream is executed

Dim ds As DataSet = me.FillData

Dim bericht As New CrystalDecisions.CrystalReports.Engine.ReportDocument

bericht.Load(Me.path.Parent.FullName & "//Rpt//tr2.rpt", CrystalDecisions.Shared.OpenReportMethod.OpenReportByDefault)

bericht.SetDataSource(ds)

Dim memstream As IO.MemoryStream = bericht.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat)

That is my assembly list

<add assembly="CrystalDecisions.CrystalReports.Engine, Version=12.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>

<add assembly="CrystalDecisions.ReportSource, Version=12.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>

<add assembly="CrystalDecisions.Shared, Version=12.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>

<add assembly="CrystalDecisions.Web, Version=12.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>

<add assembly="CrystalDecisions.ReportAppServer.ClientDoc, Version=12.0.1100.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>

<add assembly="CrystalDecisions.Enterprise.Framework, Version=12.0.1100.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>

<add assembly="CrystalDecisions.Enterprise.InfoStore, Version=12.0.1100.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>

<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>

<add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>

<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>

<add assembly="CrystalDecisions.Data.AdoDotNetInterop, Version=12.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello,

3 questions:

1. If you hard code the path of the report and report name, how does it behave?

2. If you place a viewer can you view it properly?

3. Using the viewer tool's export button does export the report properly?

Thanks.

Former Member
0 Kudos

1) I am taking the same error

2 & 3) I didnu2019t try

The thing is that under Windows XP & IIS my project works perfect.

I have just switched to Windows 7 & IIS

I forgot to mention my web.config settings

<authentication mode="Windows" />

<identity impersonate="true"></identity>

Former Member
0 Kudos

Hello,

Can you give IIS_IUSRS worker process, full control, on the report folder?

Thanks.

Former Member
0 Kudos

Well,

I gave Full permission to Users: IUSR and Network Services but still the same

Thanks in advance

Former Member
0 Kudos

I have found the following article, which is speaks about Temporary folders

I have made exactly the same and finally I can load an Rpt file from my Web server

http://www.anewdevelopment.com/2006/11/crystal-reports-access-is-denied.html

Edited by: athinaev on Jan 31, 2011 4:01 PM

Answers (1)

Answers (1)

Former Member
0 Kudos

Thanks a lot to everybody, especially to Lance Fisher which is not part of our community, but he hat an interesting Site

Best regards

athianev