A document processed by the JRC engine cannot be opened in the C++ stack

sharad picture sharad · May 31, 2012 · Viewed 69.8k times · Source

I have created a crystal report in vs2010 with .net4.0. when I publish the website it throws the error "A document processed by the JRC engine cannot be opened in C++ stack". I published the website in server and I'm trying to access it from client, I did keet the .rpt file in app_code, but again getting the same error. So I created a folder wwwroot and in that folder I kept the asp_client and website folder and I gave the physical path to wwwroot. everything working fine except crystal report. In .cs file code is as follows:

    ReportDocument rptDoc = new ReportDocument();
    DataSetForCrystalReport ds = new DataSetForCrystalReport();
    DataSetForCrystalReport dsHeader = new DataSetForCrystalReport();
    DataTable dt = new DataTable();
    DataTable dtHeader = new DataTable();
    dt.TableName = "dtBill";
    string ReceiptNo = Request.QueryString["ReceiptNo"];
    dt = getAllOrders(ReceiptNo).Tables[0];
    dtHeader = TblcompanysettingsService.GetOrganizationDetails();
    ds.Tables[1].Merge(dt);
    ds.Tables[2].Merge(dtHeader);
    rptDoc.Load(Server.MapPath("crBill.rpt"));
    rptDoc.SetDataSource(ds);
    CrystalReportViewer1.ReportSource = rptDoc;

stack trace of error:

[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) +147
   CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened() +422

[CrystalReportsException: Load report failed.]
   CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened() +549
   CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename, OpenReportMethod openMethod, Int16 parentJob) +1613
   CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename) +189
   GenerateBill.Page_Load(Object sender, EventArgs e) in e:\ShareFolder\Movie\wwwroot\Website\GenerateBill.aspx.cs:33
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25
   System.Web.UI.Control.LoadRecursive() +71
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3064

Answer

serop picture serop · Jun 13, 2013

Check your path to the .rpt file! The error description has nothing to do with its real reason. It just cannot find your .rpt file!

In my case the path had to be for a .rpt file sitting in Reports subfolder:

Server.MapPath("~/Reports/InvoiceRegular.rpt");

Worked for me.