I am getting a rainbow of errors when attempting to view reports in my c# application once deployed on a client computer.
In Visual Studio I have version 13.0.35 for CrystalReports.Design, Engine, ReportSource and Shared but I am showing 13.0.20 on Crystal Reports for .NET.
On the client I've installed the 32bit runtime which shows in Add/Rmv programs as version 13.0.19.2312.
My application structure includes multiple project files, most of which compile as Console App types and are called from the primary project. Most of the reports are in these sub-project files.
Initially I had my reports Build Action = Content and Copy to Output Directory = Copy if newer
And here is the code to load the report:
ReportDocument cryRpt = new ReportDocument(); String Path = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
Path = System.IO.Path.Combine(Path, "Reports\\Purchases_List_Rpt.rpt");
cryRpt.Load(Path);
cryRpt.SetDataSource(ds.Tables[0]); Pur_Reports rpts = new Pur_Reports();
rpts.reportSrce = cryRpt;
rpts.Text = "Purchases Listing";
rpts.Show();
rpts = null;
//Pur_Reports is just a form with the crystal report viewer control. Below is the on__load code
this.crystalReportViewer1.ReportSource = reportSrce;
this.crystalReportViewer1.Refresh();
In development, the above worked great. No problem. However, I realized that during deployment these reports weren't going to copy in the same way due to the app structure.
So I changed the report-type to Embedded. I'm going to skip a few other million errors about inability to load data, etc and say that at this point I have a Blank Report (no datasource) that I'm trying to load from my *Main* project file (not a sub-console app) and am still having trouble.
Here's the change in code based on it being embedded now:
ReportDocument myRpt = new ReportDocument();
myRpt.Load("CrystalReport1.rpt");
This still works on my dev machine. On the deployed app I'm getting the error:
'Load Report Failed' error ; "a document processed by the JRC engine cannot be opened in the C++ stack"
So, for fun I went back to having it as Content instead of Embedded and used
ReportDocument cryRpt = new ReportDocument(); String Path = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
Path = System.IO.Path.Combine(Path, "CrystalReport1.rpt");
cryRpt.Load(Path);
….
And this gives me 'Unable to cast COM object of type 'CrystalDecisions.ReportAppServer.Controllers.ReportSourceClass' to interface type 'CrystalDecisions.ReportAppServer.Controllers.ISCRReportSource'. This operation failed because the QueryInterface call on the Com component for the interface......failed due to the following error: No such interface supported.
So far Google hasn't helped me and I'm hoping I'll find my answer here. I have concerns about the version code on the Dev files vs the client machine but those are supposedly all the latest and greatest.
Thanks in advance.
Request clarification before answering.
Don't use Copy and compile, CR for VS can only use the current version, multiple version installs are not supported nor likely to ever work.
13.0.3500.0 is the 3.5 and above framework version, for SP 21 and above. 13.0.2000.0 is version 2.0 ->3.5 framework
You installed a pre-SP 22 runtime, not going to work, your app is looking for SP 21 and above runtime.
Uninstall CR for VS SP 19 from the users PC and install SP 25, latest version.
Download the EXE on your DEV PC and recompile using SP 25. Don't include the runtime in your app. The MSI will GAC most of the CR dll's and the rest will go into the SAP folder.
Then check all of the app.config files, all CR versions need to be updated to 13.0.3500.0 in the file, GUID's don't change.
Don
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 10 | |
| 5 | |
| 5 | |
| 5 | |
| 4 | |
| 2 | |
| 2 | |
| 2 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.