G
Guest
Changing connection info at run time with Crystal does not seem to work as
advertised. I've tried the code in the documentation and the code that's been
posted in the crystal group numerous times by Shariq. Here are my particulars:
..NET 1.1, SP1
Crystal Dev. 10
SQL Server
Report has one table (a command), and no subreports.
As long as I pass in a server name of "(local)", it works fine, no login
popup. Substituting any other value, including the local machine name or
"localhost" pops the login dialog. Even though correct credentials are
entered, it doesn't accept them. Oddly, the server and database fields are
grayed out and blank. I have verified in the debugger that the parameters are
being changed in the ConnectionInfo object. I also notice that there's an
undocumented member, ConnectionInfo.AllowCustomConnection, but toggling it
did not affect the outcome. I'm stumped. Seems like a lot of other people
are too. Thx.
--
Public Sub RunReport(ByVal myReport As ReportDocument)
Dim ReportViewer As ReportViewerForm
Dim myConnectionInfo As New ConnectionInfo
Dim myLogonInfo As New TableLogOnInfo
'myConnectionInfo.AllowCustomConnection() = True
myConnectionInfo.ServerName = "myServerName"
myConnectionInfo.DatabaseName = "myDatabaseName"
myConnectionInfo.UserID = "myUserId"
myConnectionInfo.Password = "myPassword"
For Each myTable As Table In myReport.Database.Tables
myLogonInfo = myTable.LogOnInfo
myLogonInfo.ConnectionInfo = myConnectionInfo
myTable.ApplyLogOnInfo(myLogonInfo)
Next
....
--
advertised. I've tried the code in the documentation and the code that's been
posted in the crystal group numerous times by Shariq. Here are my particulars:
..NET 1.1, SP1
Crystal Dev. 10
SQL Server
Report has one table (a command), and no subreports.
As long as I pass in a server name of "(local)", it works fine, no login
popup. Substituting any other value, including the local machine name or
"localhost" pops the login dialog. Even though correct credentials are
entered, it doesn't accept them. Oddly, the server and database fields are
grayed out and blank. I have verified in the debugger that the parameters are
being changed in the ConnectionInfo object. I also notice that there's an
undocumented member, ConnectionInfo.AllowCustomConnection, but toggling it
did not affect the outcome. I'm stumped. Seems like a lot of other people
are too. Thx.
--
Public Sub RunReport(ByVal myReport As ReportDocument)
Dim ReportViewer As ReportViewerForm
Dim myConnectionInfo As New ConnectionInfo
Dim myLogonInfo As New TableLogOnInfo
'myConnectionInfo.AllowCustomConnection() = True
myConnectionInfo.ServerName = "myServerName"
myConnectionInfo.DatabaseName = "myDatabaseName"
myConnectionInfo.UserID = "myUserId"
myConnectionInfo.Password = "myPassword"
For Each myTable As Table In myReport.Database.Tables
myLogonInfo = myTable.LogOnInfo
myLogonInfo.ConnectionInfo = myConnectionInfo
myTable.ApplyLogOnInfo(myLogonInfo)
Next
....
--