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
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.
this work for me
Changed
a. Build Action as "Content"
b. Copy to Output Directory as "Do not Copy"
c. Put Empty for Custom Tool and Custom Tool Namespace
Just Do These Steps
(1) Right click on your ".rpt" file Select "Properties"
1.a) Build Action as "Content"
1.b) Copy to Output Directory as "Copy Always"
(2)Check your path to the .rpt file Server.MapPath("Your path");
eg: Server.MapPath("~/Reports/MyReport.rpt");
Note: if both rpt and aspx page with report viewer are in same folder then no need to give the full path , you can give only filename.rpt in Server.MapPath .
I don't know if this will help someone else or not, but I was having this issue, and it turned out to be such a simple fix for such a dumb move. I had mistyped the filename of the .rpt file...there was a space between two words in the file name (which I normally never do for just this reason) but when I included the name in my code, I had left the space out. corrected the filename, problem went away.
Found out the solution, I was First using Visual Studio 2005 with its own crystal report and then i upraded to VS2010 with seperate crystal report which i downloaded from SAP. I researched and found from SAP:
As each version of Crystal Reports has its' own specific runtime which must be correctly deployed, it is critical that the deployed runtime be in agreement with the Crystal Reports assemblies for Visual Studio .NET referenced in your project.
so i uninstaller pervious version and used only one version and it worked. :) thanks ta.speot.is for your concern. It was never a coding problem.
Just copy the .rpt file (crystl report template ) from local machine to specific server/machine's folder and I am prey sure you can run resolve the issue CrystalDecisions.Shared.CrystalReportsException: Load report failed.
For me it worked well and no error on server side. My application is able to store pdf file to share path according the code.
I have found another set of circumstances under which this rather unhelpful error appears.
If you F5 to run/debug your web application in Visual Studio BUT still have the the report open in Crystal Reports (2011), you will get the error.
Drove me nuts for about an hour today!
Work for me: Copy .rpt files From Local Machine overwrite .rpt files on Host then it work well.
This just happened to me and after hours of headache I found it was a file permissions issue. For some reason when copying from our CR dev server to the shared custom .rpt directory the permissions on the file were all jacked up and I had to add permissions for several user groups back to the file.
copy and paste the folder (aspnet_client) from the (C:\inetpub\wwwroot) to the website folder and make sure that the .rpt file is in the same folder
Making sure the file path is correct like @serop mentioned. Also i have noticed where reports folder wouldn't get published. So had to manually publish the report folder.
Please check your .rpt file is present or not.If not please copy from local to hosting folder,it will start work.
I had the same issue with ASP.NET. Please check your report path. That will be wrong path.
User contributions licensed under CC BY-SA 3.0