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