I ran into this problem too. I overcame it by finding some code on
http://www.planet-source-code.com (below), but I was hoping to find an explanation for this, or maybe an adjustment to the book's code by the author that showed his preferred method of dealing with this since I am a CR newb.
'''-------------------------------------------------------------
''' <summary>
''' Add a reportviewer control to the page - call it crv
''' Add a reportdocument control to the page
''' Select the report you designed (EmployeeHours)
''' use the code here to login and show report in browser
''' </summary>
''' <param name="sender"></param>
''' <param name="e"></param>
''' <remarks></remarks>
''' <history>
''' [andrew] 1/7/2004 Created
''' </history>
'''-------------------------------------------------------------
Private Sub crv_load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles crv.Load
Dim crReport As ReportDocument
crReport = New EmployeeHours
ApplyLogOnInfoTo(crReport)
crv.ReportSource = crReport
End Sub
Private Sub ApplyLogOnInfoTo(ByRef crReport As ReportDocument)
Dim crLogonInfo As CrystalDecisions.Shared.TableLogOnInfo
crLogonInfo = crReport.Database.Tables(0).LogOnInfo
' what if more than one table is used?
crLogonInfo.ConnectionInfo.ServerName = "servername"
crLogonInfo.ConnectionInfo.DatabaseName = "dbname"
crLogonInfo.ConnectionInfo.UserID = "sa"
crLogonInfo.ConnectionInfo.Password = "sapwd"
crReport.Database.Tables(0).ApplyLogOnInfo(crLogon Info)
End Sub