cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot run crystal report on some computers

0 Kudos

I have an application with Crystal Reports in it. It has issues where it doesn't run on some computers. I haven't had this issue in a while so i tried to install all i remembered i needed.

First i made a simple console application that has an empty Crystal Report and all it does is instantiate the report and export to PDF right beside the EXE. Like that it's much faster to test. I put a try catch and wrote to a text file the stack trace of the error so i can debug quickly.

Ran it on my computer it works fine. Copied it onto a computer that it didn't work and tried it and it failed finding resources. I tried with 13_0_15 which is that i develop with and it doesn't work. So i installed the latest Crystal Runtime which is 13_0_22 64 bits.

Ran it again got the error :

Method not found: 'CrystalDecisions.ReportAppServer.DataDefModel.PropertyBag CrystalDecisions.ReportAppServer.ReportDefModel.ISCRExportOptions.get_ExportOptionsEx()'

Then i remembered that Crystal Report cannot run on Any CPU and that you have to specify one platform. Recompiled my Console project as x64 and now i am stuck with the following error :

The document has not been opened. at CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.set_ReportAppServer(String pbsVal)

Now I made sure the computer has .net 3.5, .net 4.7 and Microsoft Visual C++ 2012 (as i know it's a requirement for Crystal).

Anything else i could be missing that i need to install ?

I already reinstalled the Crystal runtimes thinking it might be it but it's still not working.

Here's the code i use in case someone doesn't know what i mean by simple crystal report code :

using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;
using System;
using System.Data;
using System.Diagnostics;
using System.IO;
namespace ConsoleApplication1678
{
    class Program
    {  
        static void Main(string[] args)
        {
            try
            {
                var report =newCrystalReport1();

                if(File.Exists("rpt.pdf"))
                {
                    File.Delete("rpt.pdf");
                }

                report.ExportToDisk(ExportFormatType.PortableDocFormat,"rpt.pdf");
                Process.Start("rpt.pdf");
            }
            catch(Exception ex)
            {
                var error = ex.Message+"\n\n"+ ex.StackTrace;
                File.WriteAllText("error.txt", error);
            }
        }
    }
}

Edit :

Created a brand new project very similar to the one above. The only difference is that i added a datasource to the report and added couple fields. On my PC it works perfectly. On any non developper PC it doesn't work and it still get the error :


Method not found: 'CrystalDecisions.ReportAppServer.DataDefModel.PropertyBag CrystalDecisions.ReportAppServer.ReportDefModel.ISCRExportOptions.get_ExportOptionsEx()'

Now i have installed VC++Redist 2015 on all the PC and it still doesn't work. Then i noticed i was on Any CPU, I switched to x86 and tried but the error is still there. Then i rebuilded with x64 and it suddenly works. The PC that it doesn't work all have x86 and x64 of both Crystal Report and VC++Redist why is that ? is Crystal Report not available as 32bits anymore ? That's a huge issue as i have 4 third party DLL that do not work if my applications are anything else than x86

Edit :

here are 2 image for the dll used in both mode

this is 32 bits :

And this is 64 bits :

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Search for this KBA 2719939 using Google.

Explains how to mix SP versions.

Answers (6)

Answers (6)

0 Kudos

OK, as I mentioned somewhere our runtime is for your platform and not for the OS. If you compile in 32 bit then uninstall the 64 bit MSI and install the 32 bit MSI.

0 Kudos

Ok understood. Unfortunately we will have to use another reporting software. Our users use 2 sales software that uses 32 bits crystal report and they started to fail once we installed the 64 bits. We had to reinstall the 32 bits to fix the issue. We have 2 applications to deploy inhouse and outside and one can only be 32 bits and the other can only be 64 bits. Is there any plan to have a user friendly installer that allow both. Right now people need to uninstall and reinstall crystal report for each software they uses which is completly stupid.

0 Kudos

Likely those other programs are compiled with AnyCPU, if they are x86 they should select x86 only and if x64 then select x64 for the app Platform Target in the project properties..

You won't be able to mix versions between x86 and x64 but there is no reason for those other app's to break when x64 is installed or not, as long as they are using the same runtime version they will work.

CR runtime is App platform and not OS platform, yes that would be stupid, I run x86 and x64 app's on the same PC all the time without issues.

The download link to get the SDK can be edited and change the SP number to what ever SP you want and it will download that version.

Don

0 Kudos

I don't know what these program are compiled against they are not our software they are from other companies. But anyway it doesn't matter as we are forced to use both x86 and x64 at the same time and both platform need reporting.

0 Kudos

All I can suggest is the Users who are using all of those programs need to contact each maker and ask them to upgrade to the same version.

X86 and X64 can be on the same PC but you can only have one version on it.

Don

0 Kudos

Back to the basics then. Did you install the EXE on your DEV PC and NOT any of the MSI's? The Yellow button on the download page.

Right click on the EXE and select Run As Administrator

0 Kudos

Sorry for the delay, i didn't had access to all the dev PC to check all of them. We have 14 dev PC and i checked and we all only have "SAP Crystal reports, version for Microsoft Visual Studio". It make sense since they are all perfect clones. We used the "CRforVS_XXXXXX.exe" installer.

For users we only have 64 bit computers and we install "CRRuntime_64bit_13_0_22.msi"

And we now install "vc_redist.x64.exe" which is c++ 2015 14.0.23026.

0 Kudos

CR runtime is for your application platform and not the OS, so if you compile in 64 bit then use the 64 bit MSI, if your app is compiled in 32 bit then use the 32 bit MSI on the work stations.

0 Kudos

I tried installing CRRuntime_32bit_13_0_22.msi but it said it was already installed. All i have installed on those computers is CRRuntime_64bit_13_0_22.msi.


I have both application type. Some are 32 bits and some are 64 bits. 64 bits one are because the application uses in excess of 12 gb ram (3d engine with CAD part, think solidworks). And the 32 bits one are because we have third party library that only works if the project compile type is 32 bits. I need both.

0 Kudos

Try this,

Create a new VS C# project.

From the Project directory select "Reporting" and Crystal Reports Application:

Report Wizard comes up and just click Finished.

Run the app, does that work?

Don

0 Kudos

Yes and no. Works as x64, doesn't as AnyCPU or x86

0 Kudos

You can use ProcessMonitor to compare runtime and third party dependencies, or search for a program we've used for years for 32 bit app called Modules.exe

Oh and that API is to get saved export options in the RPT file, if none are saved in the report then an execption is thrown when you try to get it.

I suggest either making sure you have PDF export options saved in the RPT's or simply ignore the exception when trying to get the Saved Export Options in your app.

0 Kudos

hum, Okay.... I have never heard of such option and i have been working with Crystal since VB6.0. Where would that Saving option would be nowadays in Visual Studio 2015 and how do i set it ?

I have many program built in x86 (so 32 bits) that have couple hundreds of report and i have never set such property and they work on most PC without any try catch. Should i change those too ?

0 Kudos

I have attached the running library to my original post for both 32 and 64 bits. 32 bits look fine and 64 bits i see a few of them using an actual 64 bits.

0 Kudos

Sorry, it's the dump generating that message.... And there is an option to save export options in the full Report Designer, not available in CR in VS.

I don't see the version of Windows mentioned anywhere?

0 Kudos

Windows 7 and 10 both 64 bits

0 Kudos

Don't know. you'll have to do more debugging, why it works in x64 mode but not x86 is ood because you said those dependencies need x86. MAybe the dependencies need to be compiled using 4.7 framework...

0 Kudos

I do not have access to 4.7. My Visual Studio 2015 is a clean install on a newly built computer in june. All i have installed is the basic setup with C# and nothing else (no azure, no web development.. etc) I added 3 third party integrated tools, Telerik, AnkSVN and Crystal report for visual studio. So i only have access to 4.6.1 maximum. I have couple tens of thousands of clients connecting daily on our application and using it without problem. And i have a large amount of in house computers that all works 64 bits but not 32 bits and 90% of them have the exact same computer part and windows 10 pro and same windows windows update. Do you have any utility i can run on their PC to figure out what is missing ? I tried installing and reinstalling the crystal runtime without success on random computers. Can i get in contact with a dev that would be able to tell me what in your code throw that exception so i can at least know what i need to look for. I don't have the source code or don't know how to get it otherwise i would already have checked myself.

0 Kudos

Update to SP 23:

https://answers.sap.com/tags/281348484285791548287640397557224

CR requires VC 2015 C++ runtime not 2012.

Don

0 Kudos

I just installe the runtime C++ 2015 runtime and no change. Still the same error :

See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box. ************** Exception Text ************** System.MissingMethodException: Method not found: 'CrystalDecisions.ReportAppServer.DataDefModel.PropertyBag CrystalDecisions.ReportAppServer.ReportDefModel.ISCRExportOptions.get_ExportOptionsEx()'. at CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqContext) at CrystalDecisions.CrystalReports.Engine.FormatEngine.ExportToStream(ExportRequestContext reqContext) at CrystalDecisions.CrystalReports.Engine.FormatEngine.Export(ExportRequestContext reqContext) at CrystalDecisions.CrystalReports.Engine.FormatEngine.Export() at CrystalDecisions.CrystalReports.Engine.ReportDocument.Export()