Search code examples
asp.netcrystal-reports

Crystal report: Access to the report file is denied. The file may be used by another program


I am creating a crystal report. It works fine on the localhost but when I uploaded it to the server, I got this problem:

Access to the report file is denied. The file may be used by another program.]
   CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.Open (Object & paper path, Int32 Options) +0
   CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.Open (Object & paper path, Int32 Options) 159
   CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened () 492

[Crystal Report Exception: Loading the report failed.]
   CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened () 678
   CrystalDecisions.CrystalReports.Engine.ReportDocument.Load (String filename, open report method Open method, Int16 parentJob) 1750
   CrystalDecisions.CrystalReports.Engine.ReportDocument.Load (String filename) 219
   WebPortal.volumeReporting.Page_Load (Object sender, EventArgs e) 95
   System.Web.Util.CalliHelper.EventArgFunctionCaller (IntPtr fp, Object o, Object t, EventArgs e) +25
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback (Object sender, EventArgs e) 42
   System.Web.UI.Control.OnLoad (EventArgs e) 132
   System.Web.UI.Control.LoadRecursive () 66
   System.Web.UI.Page.ProcessRequestMain (Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) 2428

ReportDocument reportdoc = new ReportDocument();

reportdoc.Load(Server.MapPath("report/wasteReport.rpt"));

I already gave the permission "write" for the folder "report".


I have installed http://downloads.businessobjects.com/akdlm/cr4vs2010/CRforVS_redist_install_64bit_13_0_1.zip on the server


Solution

  • I found the solution here: http://forums.asp.net/t/985047.aspx

    It is to give full permission for the folder: C:/Windows/temp

    However, I find it strange of giving that folder in a full permission mode. Anyway that, I can set the folder is used for the reporting not in C:/WIndows/temp but in my custom folder?