Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/339.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# Crystal Report请求在客户端计算机上登录_C#_.net_Visual Studio_Crystal Reports - Fatal编程技术网

C# Crystal Report请求在客户端计算机上登录

C# Crystal Report请求在客户端计算机上登录,c#,.net,visual-studio,crystal-reports,C#,.net,Visual Studio,Crystal Reports,我已经通过下面的代码传递了crystal report的登录信息。但是当我在客户机上安装软件并试图打开它时,会再次询问登录名 以下代码用于内部登录 CReport.SimpleCrystalReportViewer simple = new CReport.SimpleCrystalReportViewer(); // simple.Show(); CReport.EmployeeVisaDetail report = new CR

我已经通过下面的代码传递了crystal report的登录信息。但是当我在客户机上安装软件并试图打开它时,会再次询问登录名

以下代码用于内部登录

CReport.SimpleCrystalReportViewer simple = new CReport.SimpleCrystalReportViewer(); //
                simple.Show();
                CReport.EmployeeVisaDetail report = new CReport.EmployeeVisaDetail();
                TableLogOnInfos crtableLogoninfos = new TableLogOnInfos();
                TableLogOnInfo crtableLogoninfo = new TableLogOnInfo();
                ConnectionInfo crConnectionInfo = new ConnectionInfo();
                Tables CrTables;
                report.Load();
                crConnectionInfo.ServerName = db.ServerName;
                crConnectionInfo.DatabaseName = db.DataBase;
                crConnectionInfo.UserID = db.UserName;
                crConnectionInfo.Password =  db.Password;

                CrTables = report.Database.Tables;
                foreach (CrystalDecisions.CrystalReports.Engine.Table CrTable in CrTables)
                {
                    crtableLogoninfo = CrTable.LogOnInfo;
                    crtableLogoninfo.ConnectionInfo = crConnectionInfo;
                    CrTable.ApplyLogOnInfo(crtableLogoninfo);
                }



                simple.crystalReportViewer1.ReportSource = report;
                simple.crystalReportViewer1.RefreshReport(); 

                simple .crystalReportViewer1.Zoom(1);

当我打开报告时询问登录。

我确实有完全相同的问题,您是如何在报告本身中配置数据源设置的。代码中没有给出它