Search code examples
c#.netcrystal-reports

Can't figuring out what library is missing


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. So i installed the latest Crystal Runtime i need 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 = new CrystalReport1();               

                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);               
            }
        }
    }
}

Solution

  • Got my answer from SAP directly. Short version i need to use the latest version and tell all my clients to give me the list of all software they use that uses crystal so i can call these company and make them upgrade to the newest version because you cannot have 2 versions installed at the same time and they all need to be the same Bit format.

    My application MUST run 64 bits as we use in excess of 20 gb of ram so i need to call all other application vendor to make their application 64 bits compiled version as by installing the latest makes all their program failed.