Crystal report registery key permission error, with using crystalreportviewer in C#

2.9k Views Asked by At

In a C# Windows form project, I used "CrystalReportViewer" control to view ".rpt" files. It works correctly and loads rpt files correctly. But...

Unfortunately, in other systems, it's exe file encountered with this error:

Ether the Crystal Reports registry key permissions are insufficient ... 

Therefore the rpt files can't be shown!

What is the problem in other systems????

My project is created in Visual Studio 2015. And in other systems, I run and installed the x86 and x64 CRRuntime (version 18, and older) the versions 10 and 11 of crystal report are installed in all systems, and they registered correctly.

I tested this: compiling exe by setting the "Target Framework" on ".NET Framework 4" and "4.5". Unfortunately, it has same error...

In all my tests, the rpt files there are in the current path of exe.

Please Help Me! thank you

//***** This is my testing code:

private void crystalReportViewer1_Load(object sender, EventArgs e)
{
    ReportDocument cryRpt = new ReportDocument();
    cryRpt.Load(strRptPath);
    cryRpt.DataSourceConnections[0].SetConnection("MyServer", "DBName", false);
    cryRpt.DataSourceConnections[0].IntegratedSecurity = true;

    cryRpt.SetParameterValue("CenterName", strCenterName);
    cryRpt.RecordSelectionFormula = "{Table.Field} = 'value'";

    crystalReportViewer1.ReportSource = cryRpt;
    crystalReportViewer1.Refresh();
}
2

There are 2 best solutions below

0
On

This could be an issue that Crystal Runtime installer for legacy crystal reports not playing well with modern windows operating system as crystal report is sold out to SAP and now superseded by new reporting infrastructure like BI etc.

I've tackled such issue in migrating VB6 Crytal Reports to Windows 10 (x64) without modifications. Here Runtime Installers are not made for VB6. In my opinion reverse engineer and generate installer from crytal libraries of working node and use it to install on any system w.r.t your code. Also make sure to check Register for COM Interop option in project settings. At times it also helps.

0
On

Have you checked the regedit permissions for the CR for the user?

Set the user permissions for the selected folder to "Full Access".

For Crystal Reports XI:

  • HKEY_LOCAL_MACHINE\Software\Wow6432Node\Business Objects\Suite 11.0\ (on 64 bit OS)
  • HKEY_LOCAL_MACHINE\Software\Business Objects\Suite 11.0\ (on 32 bit OS)
  • HKEY_CURRENT_USER\Software\Business Objects\Suite 11.0\

For Crystal Reports 10:

  • HKEY_LOCAL_MACHINE\Software\Crystal Decisions\10.0\
  • HKEY_CURRENT_USER\Software\Crystal Decisions\10.0\