4

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

2 回答 2

0

这可能是一个问题,旧版 Crystal Reports 的 Crystal Runtime 安装程序无法与现代 Windows 操作系统很好地配合,因为 Crystal Report 已售罄给 SAP,现在被新的报告基础设施(如 BI 等)取代。

我在迁移VB6 Crytal ReportsWindows 10 (x64)没有修改的情况下解决了这样的问题。这里Runtime Installers不是为 VB6 制作的。在我看来,逆向工程并从工作节点的水晶库生成安装程序,并使用它在任何系统上安装您的代码。还要确保在项目设置中选中Register for COM Interop选项。有时它也有帮助。

于 2017-02-24T07:43:21.133 回答
0

您是否检查了用户 CR 的 regedit 权限?

将所选文件夹的用户权限设置为“完全访问”。

对于水晶报表 XI:

  • HKEY_LOCAL_MACHINE\Software\Wow6432Node\Business Objects\Suite 11.0\(在 64 位操作系统上)
  • HKEY_LOCAL_MACHINE\Software\Business Objects\Suite 11.0\(在 32 位操作系统上)
  • HKEY_CURRENT_USER\Software\Business Objects\Suite 11.0\

对于水晶报表 10:

  • HKEY_LOCAL_MACHINE\Software\Crystal Decisions\10.0\
  • HKEY_CURRENT_USER\Software\Crystal Decisions\10.0\
于 2017-02-24T07:56:00.767 回答