Hello
I have created simple crystal report and I can view it succesfully using CrystalReportViewer. The code I use i
***************************
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Loa
Dim myReport As New Test1(
LogonToDatabase(myReport, "scott", "tiger"
CrystalReportViewer1.ReportSource = myRepor
End Su
***************************
Private Sub LogonToDatabase(ByVal myReport As CrystalDecisions.CrystalReports.Engine.ReportDocument,
ByVal UserId As String, ByVal Password As String
Dim myLogonInfo As New CrystalDecisions.Shared.TableLogOnInfo(
Dim mytable As CrystalDecisions.CrystalReports.Engine.Tabl
For Each mytable In myReport.Database.Table
myLogonInfo = mytable.LogOnInf
With myLogonInfo.ConnectionInf
.UserID = UserI
.Password = Passwor
End Wit
mytable.ApplyLogOnInfo(myLogonInfo
Next mytabl
End Su
***************************
My problem is whenever I execute different reports, the above code create a new database connection as coded obviousely. Is there any other method where I can use existing connection and pass it to "myLogonInfo". I do not want to use DataSet or any other method (XML). Is there any way I can use my application's database connection to execute crystal report or use only one connection to execute multiple crystal reports in a session
Many Thanks in advanc
Sameer
|