I have an asp application that runs a Crystal Report (pull method). I dont't seem to get past error in my connection. I need the Crystal Report connect to different servers depending upon user selection. The data base and sign on are always the same.
Here is my attempt:
Dim
myPath As String = (Server.MapPath("PlantSalesReport.rpt"))
myCrystalReport1.Load(myPath)
myCrystalReport1.SetParameterValue(
"Ask-Date", DropDownList2.SelectedValue)
CrystalReportViewer1.ReportSource = myCrystalReport1
CrystalReportViewer1.Zoom(100)
CrystalReportViewer1.Width = 500
Dim myLogin As New ConnectionInfo
myLogin.ServerName =
"RG5543"
myLogin.DatabaseName =
"C:\Program Files\Astec Industries\WM2000\Data\WM2000DATA.add"
myLogin.UserID =
"xxxx"
myLogin.Password =
"yyyy"
Dim myTables As Tables = myCrystalReport1.Database.Tables
For Each myTable As CrystalDecisions.CrystalReports.Engine.Table In myTables
Dim myTableLogonInfo As TableLogOnInfo = myTable.LogOnInfo
myTableLogonInfo.ConnectionInfo = myLogin
myTable.ApplyLogOnInfo(myTableLogonInfo)
myTable.Location = myTable.LogOnInfo.TableName
NextNow when I runn the app I get error:
Failed to open the connection. Failed to open the connection. C:\WINDOWS\TEMP\PlantSalesReport {64260EE9-7818-45DC-8D07-381284D2DEB8}.rpt