Torna al Thread
Dim report As ReportDocument = New ReportDocument
Dim nr As Integer, i As Integer
Try
report.Load(nomeReport)
Dim logOnInfo As New TableLogOnInfo
nr = report.Database.Tables.Count
For i = 0 To nr - 1
logOnInfo = report.Database.Tables.Item(i).LogOnInfo
logOnInfo.ConnectionInfo.ServerName = cSettings.server_name
logOnInfo.ConnectionInfo.DatabaseName = cSettings.db_name
logOnInfo.ConnectionInfo.UserID = cSettings.dbUser
logOnInfo.ConnectionInfo.Password = cSettings.dbPassword
logOnInfo.TableName = report.Database.Tables.Item(i).Name
report.Database.Tables(i).ApplyLogOnInfo(logOnInfo)
Next
crViewer.ToolPanelView = CrystalDecisions.Windows.Forms.ToolPanelViewType.None
Me.crViewer.ReportSource = report
Catch ex As Exception
MsgBox("Errore nella stampa del report " & ex.Message, MsgBoxStyle.OkOnly + MsgBoxStyle.Exclamation)
End Try