使用的CrystalReportViewer在C#Windows窗体项目,我用“的CrystalReportViewer”控件来查看“ RPT”文件。它工作正常并正确加载rpt文件。但是......Crystal报表系统登录键权限错误,在C#
不幸的是,在其他系统中,它与这个错误遇到exe文件:
Ether the Crystal Reports registry key permissions are insufficient ...
因此,RPT文件无法显示!
其他系统有什么问题?
我的项目是在Visual Studio 2015年 而在其他系统中创建的,我运行和安装x86和x64 CRRuntime(18版以上) 版本10和水晶报告11安装在所有系统中,并正确注册。通过设置” .NET框架4" 和‘4.5’的“目标框架”编译EXE:
我测试了这一点。不幸的是,它具有同样的错误......
在我所有的测试中,RPT文件中有EXE的电流通路。
请帮帮我! 谢谢
//***** 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();
}
添加一些代码,显示如何使用水晶报告。 –
我编辑了我的问题并输入了我的代码。谢谢您的回答@Shashi的Bhushan – nabegheh95
我没有看到任何代码的问题,它必须与问题的编译目标平台。我记得,如果我们尝试用x64位进行编译,那么水晶报告会抱怨,但在x86配置上工作正常。所以你可以尝试用x86编译并看看。 –