Skip to Content
0
Former Member
May 21, 2009 at 05:18 PM

crystalreportviewer

25 Views

hi, I want to change the conecction to my report on ejecution time, I'm working with visual basic 2005 and crystal reports 2008, but I just can't do that because the report(using the crystalreport viewer to see the report) doesn't change the database nor the server, I have been trying with the next code

firts:

Imports CrystalDecisions.Shared

Imports CrystalDecisions.CrystalReports.Engine

next:

Dim crTableLogonInfo As New TableLogOnInfo

Dim crConnectionInfo As New ConnectionInfo

next: crvhistorial is the name of the crystalreportviewer

Private Sub SetDBLogonForReport(ByVal myConnectionInfo As ConnectionInfo)

Dim crTableLogonInfos As TableLogOnInfos = Me.crvhistorial.LogOnInfo

For Each myTableLogOnInfo As TableLogOnInfo In crTableLogonInfos

myTableLogOnInfo.ConnectionInfo = myConnectionInfo

Next

End Sub

Private Sub ConfigureCrystalReports()

Dim myConnectionInfo As ConnectionInfo = New ConnectionInfo()

myConnectionInfo.IntegratedSecurity = True

myConnectionInfo.DatabaseName = dll.conexionsql.Database

myConnectionInfo.ServerName = dll.conexionsql.DataSource

SetDBLogonForReport(myConnectionInfo)

End Sub

and:

at the from's load I call the procedure: ConfigureCrystalReports()