I have a crystal report developed in VS-2015 and is hosted as a Web application in IIS Server.
The reports work perfectly fine for a short period of time, and after few minutes this error start appearing on client browsers:
[COMException (0x80041811): Unsupported Operation. A document processed by the JRC engine cannot be opened in the C++ stack.] CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.Open(Object& DocumentPath, Int32 Options) +0 CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.Open(Object& DocumentPath, Int32 Options) +90 CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened() +258
[CrystalReportsException: Load report failed.] CMS.COD.CustomerPortalNT.CustomerLoadsheet.btnPrintReport_Click(Object sender, EventArgs e) in E:\Office Sources\COD PORTALS\CMS.COD.CustomerPortal\CMS.COD.CustomerPortal\CMS.COD.CustomerPortalNT\CustomerLoadsheet.aspx.cs:411 System.Web.UI.WebControls.Button.OnClick(EventArgs e) +9628114 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +103 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +35 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1724
However this error goes once I restart my IIS Server. I have tried many solutions posted here before, but none of them works.
Here is my code to download the crystal report (Server code):
DataTable dataTable = (DataTable)Session["DT"];
ReportDocument crystalReport = new ReportDocument();
crystalReport.Load(Server.MapPath("~/XRPT/rptLoadSheetPrint.rpt"));
crystalReport.SetDataSource(dataTable);
crystalReport.ExportToHttpResponse(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, Response, true, "PersonDetails");
crystalReport.Close();
crystalReport.Dispose();
I have already tried following things but all in vain:
Can anyone help me what could be the problem?
User contributions licensed under CC BY-SA 3.0