SAP Knowledge Base Article - Public

1661224 - Error: Access to report file denied - Using Crystal Report SDK for Visual Studio .NET

Symptom

  • WCF service exports a Crystal Report to an Adobe pdf file format
  • The export works without errors on a development computer
  • When the WCF service is deployed and run on an IIS server, the following error is thrown:

System.Runtime.InteropServices.COMException: Error in File MyReport {97AC876B-F7A4-44C6-9130-A069DC4DF843}.rpt:
Access to report file denied. Another program may be using it.
at CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.Open(Object& DocumentPath, Int32 Options)
at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.Open(Object& DocumentPath, Int32 Options)
at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened()
--- End of inner exception stack trace ---
at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened()
at CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename, OpenReportMethod openMethod, Int16 parentJob)
at CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename)

Environment

  • Crystal Reports for Visual Studio 2010
  • Visual Studio 2010

Cause

  • The Crystal Reports engine needs to write temp files to a Windows %TMP% path
  • The correct permissions on this path were not granted

Resolution

  • Set the network service permissions on the %TMP% folder
  • Use Process Monitor to determine what permissions may be missing

Keywords

CR2010 2010 CR4VS2010 CR4VS VS2010 NET2010 Crystal Reports for .NET Framework 4.0 crforvs 13 Internet Explorer security process , KBA , BI-DEV-NET-SDK , .NET SDK / COM SDK , How To

Product

SAP Crystal Reports, developer version for Microsoft Visual Studio