Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello. I have a web form that a user can print a Crystal Report from it. When the user clicks print this error come up:

HTML
Access to report file denied. Another program may be using it.


Why am I getting this error? Everything is working on the Deve computer.

Here is the whole error code:

HTML
 Error in File FormGradReport {6E3BB69D-6FCE-4568-AAEF-9036CD2D3610}.rpt:
Access to report file denied. Another program may be using it.
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: Error in File FormGradReport {6E3BB69D-6FCE-4568-AAEF-9036CD2D3610}.rpt:
Access to report file denied. Another program may be using it.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[COMException (0x80000220): Error in File FormGradReport {6E3BB69D-6FCE-4568-AAEF-9036CD2D3610}.rpt:
Access to report file denied. Another program may be using it.]
   CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.Open(Object& DocumentPath, Int32 Options) +0
   CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.Open(Object& DocumentPath, Int32 Options) +147
   CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened() +431

[CrystalReportsException: Load report failed.]
   CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened() +558
   CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename, OpenReportMethod openMethod, Int16 parentJob) +1626
   CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename) +189
   SACSCOCLogin1._1.ReportFormGrad.Page_Load(Object sender, EventArgs e) in C:\Users\Public\Documents\Visual Studio 2010\Projects\SACSCOCLogin1.1\SACSCOCLogin1.1\ReportFormGrad.aspx.cs:42
   System.Web.UI.Control.LoadRecursive() +71
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3178


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18447 
Posted
Comments
Richard C Bishop 8-Apr-14 10:51am    
My guess is that you are possibly reading or writing a file and not closing the reader/writer or the connection to it.
Computer Wiz99 8-Apr-14 10:59am    
Ok. Thanks. IO got that part fixed. Now I have another issue. I keep getting Database logon failed on just one of the reports. All of the other reports show up fine and print out. I checked on the report in CR 2013 and made sure the report is logged on to the database and everything checks out. Why is it doing that?
Richard C Bishop 8-Apr-14 11:03am    
I couldn't tell you. I am not very privy to CrytalReports. I am going to go ahead and post my comment as the solution since it did in fact solve your initial issue.
Computer Wiz99 8-Apr-14 11:06am    
Ok Thanks any way. Sure why not. Saves me some time for typing it out.

1 solution

The error is indicative of having written to or read from a file and failing to close the reader/writer and possibly the connection to the file. Check your IO operations and make sure all openings have closings.
 
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