on 11-04-2011 8:35 AM
We have too many reports designed by Crystal Reports XI Release 2 a time ago reports are old but we are calling them in asp.net 4.0 and connection through ODBC Data Sources (Driver SQL SERVER)
but when we refresh the report we are facing this issue....
-
Failed to open the connection.
Details: [Database Vendor Code: 17 ] Failed to open the connection.
AP Outstanding Check Run Detailed Ver 2 {CF3B13A2-F259-4B1D-ACC9-BF78F44D4AA5}.rpt
Details: [Database Vendor Code: 17 ]
-
here is the code to set ReportLoginInfo
CrystalDecisions.Shared.TableLogOnInfo logonInfo = new CrystalDecisions.Shared.TableLogOnInfo();
string myTableLocation;
foreach (CrystalDecisions.CrystalReports.Engine.Table myTable in rptDoc.Database.Tables)
{
myTableLocation = myTable.Name;
logonInfo = myTable.LogOnInfo;
logonInfo.ConnectionInfo.AllowCustomConnection = true;
logonInfo.ConnectionInfo.ServerName = ServerName; // dnsname
logonInfo.ConnectionInfo.DatabaseName = DatabaseName;
if (!(string.IsNullOrEmpty(UserID) || string.IsNullOrEmpty(Password)))
{
logonInfo.ConnectionInfo.UserID = UserID;
logonInfo.ConnectionInfo.Password = Password;
logonInfo.ConnectionInfo.IntegratedSecurity = false;
}
logonInfo.ConnectionInfo.Type = CrystalDecisions.Shared.ConnectionInfoType.SQL;
myTable.ApplyLogOnInfo(logonInfo);
myTable.Location = DatabaseName + ".dbo." + myTableLocation;
bool success = myTable.TestConnectivity();
Edited by: zeshansadiq on Nov 4, 2011 3:49 PM
resolved by me itself.
Do the following steps:
1. Open the report in the CR XI designer.
2. Select Database -> Set Datasource Location.
3. Set Datasource Location window will appear and in the replace with section connect to the database and replace these tables with the tables in the current datasource by clicking the update button.
4. After updating close the Set Datasource Location window.
5. Go to 'Database menu' and Click 'Verify Database' and click on u2019OKu2019.
6. Preview the report and the save the report.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Moved to .NET SDK forum.
Also search on ReplaceConnection and you'll find sample code on how to update the connection info in code.
SQL Server 2008 only supports the Native 10 driver according to Microsoft.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.