In a C # Windows form project, I used the CrystalReportViewer control to view the ".rpt" files. It works correctly and loads rpt files correctly. But...
Unfortunately, on other exe systems, the file encounters this error:
Ether the Crystal Reports registry key permissions are insufficient ...
Therefore rpt files cannot be displayed!
What is the problem in other systems ????
My project was created in Visual Studio 2015. And on other systems I run and install x86 and x64 CRRuntime (version 18 and older) versions 10 and 11 of the crystal report are installed on all systems, and they registered correctly.
I tested this: by compiling exe, setting the "Target Framework" to ".NET Framework 4" and "4.5". Unfortunately, he has the same error ...
In all my tests, rpt files are in the current exe path.
Please help me! thank
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();
}
source
share