I am using VS 2008 to develop an application. I am using Win 10(x64). I completed my development and everything is working just fine in my PC. But when I install the app in another machine crystal report is asking for User/Password every time. Even if I provide the correct username and password it says "Login Failed". I used SQL server native client to connect SQL tables in crystal reports. Here is my code to load the report from the app.
TableLogOnInfos crtableLogoninfos = new TableLogOnInfos();
TableLogOnInfo crtableLogoninfo = new TableLogOnInfo();
ConnectionInfo crConnectionInfo = new ConnectionInfo();
Tables CrTables;
//report object
TupUp tp = new TupUp();
crConnectionInfo.ServerName = "SOFTWARE\\sqlexpress";
crConnectionInfo.DatabaseName = "DBname";
crConnectionInfo.UserID = "uname";
crConnectionInfo.Password = "pwd";
CrTables = tp.Database.Tables;
//CrTables = dea.Database.Tables;
foreach (CrystalDecisions.CrystalReports.Engine.Table CrTable in CrTables)
{
crtableLogoninfo = CrTable.LogOnInfo;
crtableLogoninfo.ConnectionInfo = crConnectionInfo;
CrTable.ApplyLogOnInfo(crtableLogoninfo);
}
//report viewer object
RV RV = new RV();
RV.crystalReportViewer1.DisplayGroupTree = false;
tp.SetParameterValue("month", cmbMonth.Text);
tp.SetParameterValue("year", cmbYear.Text);
//tp.SetParameterValue("weekdays", weekdays);
RV.crystalReportViewer1.ReportSource = tp;
RV.Refresh();
RV.Show();
Please check if I am doing anything wrong in the above code. Thanks in advance.