Crystal报告注册密钥权限错误,在C#中使用crystalreportviewer
发布时间:2020-12-15 21:05:19 所属栏目:百科 来源:网络整理
导读:在C# Windows窗体项目中,我使用“CrystalReportViewer”控件来查看“.rpt”文件.它正常工作并正确加载rpt文件.但… 不幸的是,在其他系统中,遇到此错误的exe文件: Ether the Crystal Reports registry key permissions are insufficient ... 因此无法显示rpt
在C#
Windows窗体项目中,我使用“CrystalReportViewer”控件来查看“.rpt”文件.它正常工作并正确加载rpt文件.但…
不幸的是,在其他系统中,遇到此错误的exe文件: Ether the Crystal Reports registry key permissions are insufficient ... 因此无法显示rpt文件! 其他系统有什么问题???? 我的项目是在Visual Studio 2015中创建的. 我测试了这个:通过在“.NET Framework 4”和“4.5”上设置“Target Framework”来编译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(); } 解决方法
这可能是传统水晶报告的Crystal Runtime安装程序与现代Windows操作系统不能很好地兼容的问题,因为水晶报告已销售给SAP,现在已被BI等新的报告基础设施所取代.
我已经解决了将VB6 Crytal Reports迁移到Windows 10(x64)而没有修改的问题.此处运行时安装程序不适用于VB6.在我看来,逆向工程师从工作节点的crytal库生成安装程序,并使用它在任何系统上安装你的代码.另外,请确保在项目设置中选中Register for COM Interop选项.有时它也有帮助. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |