Server Error in '/' Application. The document has not been opened. 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: The document has not been opened.
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 (0x8004180b): The document has not been opened.] CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.get_ReportAppServer() +0 CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.get_ReportAppServer() +33 CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened() +181
[CrystalReportsException: Load report failed.] CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened() +321 CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename, OpenReportMethod openMethod, Int16 parentJob) +851 CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename) +78 NSEXIM.TestPage1.Page_Load(Object sender, EventArgs e) +18481 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.34209`
I had the same problem and could not find a solution. After many hours of suffering I figured out making the assembly COM Visible worked.
Might seem odd... The problem is not on the Crystal Report itself so ProcMon.exe is not going to help. I did this analysis for 2 hours. The file is not even touched which confirmed the problem was with the instantiation of ReportDocument. So when debugging and stepping until you reach ReportDocument repDoc = ReportDocument() in your code it crashes right here and the exception reports: COMException (0x8004180b): The document has not been opened.]. This is what gave me the hint. Hope this helps another poor soul that is suffering the same. Happy hunting. Regards Mr X.
User contributions licensed under CC BY-SA 3.0