Thanks for your response.
The code executes without catching, but the logon screen still appears. Here's my code:
Public myGlobalReport As New ReportDocument
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
GetReportConnection(Me.myG
End Sub
Private Sub GetReportConnection(ByVal myReport As ReportDocument)
'Objects used to set the proper database connection information
Dim tbCurrent As CrystalDecisions.CrystalRe
Dim tliCurrent As CrystalDecisions.Shared.Ta
Try
'load the report
myReport.Load("C:\Inetpub\
'set the connection information for all the tables used in the report
For Each tbCurrent In myReport.Database.Tables
tliCurrent = tbCurrent.LogOnInfo
With tliCurrent.ConnectionInfo
.ServerName = "(local)"
.DatabaseName = "dbName"
.UserID = "dbUser"
.Password = "dbPW"
End With
tbCurrent.ApplyLogOnInfo(t
Next tbCurrent
Catch ex As LoadSaveReportException
MsgBox("Incorrect path for loading report.", MsgBoxStyle.Critical, "Load Report Error")
Catch ex As Exception
ex.ToString()
End Try
End Sub
Main Topics
Browse All Topics





by: planoczPosted on 2007-03-27 at 20:45:22ID: 18805612
You need something like this.....
ports.Engi ne.Table bleLogOnIn fo
OpenReport Method.Ope nReportByT empCopy)
liCurrent)
Public myReport As New ReportDocument 'Gobal Report Doc
Private Sub GetReportConnection(ByVal myReport)
' Objects used to set the proper database connection information
Dim tbCurrent As CrystalDecisions.CrystalRe
Dim tliCurrent As CrystalDecisions.Shared.Ta
Try
' Load the report
myReport.Load(sAppPath & sReportPath & sReportName, CrystalDecisions.[Shared].
' Set the connection information for all the tables used in the report
For Each tbCurrent In myReport.Database.Tables
tliCurrent = tbCurrent.LogOnInfo
With tliCurrent.ConnectionInfo
.ServerName = sDBServer
.UserID = sUSERid
.Password = ""
.DatabaseName = sDBName
End With
tbCurrent.ApplyLogOnInfo(t
Next tbCurrent
Catch Exp As LoadSaveReportException
MsgBox("Incorrect path for loading report.", _
MsgBoxStyle.Critical, "Load Report Error")
Catch Exp As Exception
MsgBox(Exp.Message & " in GetReportConnection Procedure", MsgBoxStyle.Critical, "General Error")
End Try
End Sub