hi all,
I have created some independent reports through crystal reports developer edition v 10 and developed a small tool in .net framework v 1.1 to view these reports through the crystal reports viewer provided by .net.
This is a stand-alone windows application and nothing to do with the server. I am using local SQL anywhere database and connection is via an ODBC DSN.
Before launching the reports I am passing the login information to the reports. The code for the login information is as follows:
TableLogOnInfo crystalTableLogin;
foreach(Table crTable in currentReport.Database.Tables)
{
crystalTableLogin = crTable.LogOnInfo;
crystalTableLogin.ConnectionInfo.ServerName = "XXX"; crystalTableLogin.ConnectionInfo.UserID= "XXX";
crystalTableLogin.ConnectionInfo.Password = "XXX"
crTable.ApplyLogOnInfo(crystalTableLogin);
}
The code works fine for all reports using Tables but not for reports using Command objects. It throws an exception stating Logon failed.
Any ideas how to resolve the issue.
Thanks in advance.
Mukesh