Hi,
I have implemented a console application which takes arguments from our web application and generated and print reports. Reports are made using Crystal Reports.
ConnectionInfo myConnectionInfo = new ConnectionInfo();
myConnectionInfo.ServerName = serverName;
myConnectionInfo.DatabaseName = databaseName;
myConnectionInfo.UserID = userID;
myConnectionInfo.Password = password;
myConnectionInfo.IntegratedSecurity = false;
foreach (CrystalDecisions.CrystalReports.Engine.Table crTable in rptDoc.Database.Tables)
{
TableLogOnInfo crtableLogoninfo = new TableLogOnInfo();
crtableLogoninfo.TableName = crTable.Name;
crtableLogoninfo.ConnectionInfo = myConnectionInfo;
crTable.ApplyLogOnInfo(crtableLogoninfo);
}
rptDoc.SetDatabaseLogon(userID, password, serverName, databaseName);
rptDoc.ExportToDisk(ExportFormatType.PortableDocFormat, Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "ticketreceipt.pdf"));
I have used the above method to authenticating crystal report upon SQL server. and it is working well on all servers which has SQL 2008.
Now on the new server with SQL 2012 this same code is giving "Databse login failed" error. Though this same code is working fine with SQL 2008 and SQL 2012 locally.
After that I have also used the method to fill dataset with required data and then assign it to Report but it is not working.
Please help me in this, I thanks to all in advance.