Crystal报告注册密钥权限错误,在C#中使用crystalreportviewer [英] Crystal report registery key permission error, with using crystalreportviewer in C#
问题描述
在C#windows窗体项目中,我使用CrystalReportViewer控件来查看.rpt文件。它正常工作,并加载rpt文件。但是......
不幸的是,在其他系统中,它的exe文件出现了这个错误:
Hi,
In a C# windows form project, I used "CrystalReportViewer" control to view ".rpt" files. It works correctly and loads rpt files corredctly. But...
Unfortunately, In other systems, it's exe file occurred with this error:
Ether the crystal Reports registry key permissions are insufficient ...
因此rpt文件无法显示!
其他系统有什么问题????
我的项目是用Visual创建的在其他系统中,我运行并安装了x86和x64 CRRuntime(版本18及更早版本),所有系统都安装了水晶报告版本10和11,并且它们已正确注册。
我测试了这个:编译exe通过在.NET Freameword 4和4.5上设置Target Framework。不幸的是,它有同样的错误......
在我的所有测试中,rpt文件都在exe的当前路径中。
请帮帮我!谢谢
// *****这是我的测试代码:
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 Freameword 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();
}
}
我尝试过: <在b窗体中查看.rpt文件C#project
What I have tried:
to view .rpt file in a windows form C# project
推荐答案
以下dll的版本(即
我在项目中添加了那些参考文件,在10中使用了。
我将此文件更改为版本13然后在其他系统中正确编译运行
我不知道为什么版本10不正确
谢谢
the version of below dlls (that I had added those in reference ) using in project, was 10.
I change this file to version 13 then it's compiled run correctly in other system
I don't know why the version 10 was not correct
thanks
这篇关于Crystal报告注册密钥权限错误,在C#中使用crystalreportviewer的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!