I got this code from a book but there are errors all over this:
VB Code:
Me.Cursor = Cursors.WaitCursor Try Dim oRpt As New ReportDocument oRpt.Load("..\Reports\" & strTransaction) Dim tbCurrent As CrystalDecisions.CrystalReports.Engine.Table Dim tliCurrent As CrystalDecisions.Shared.TableLogOnInfo For Each tbCurrent In oRpt.Database.Tables tliCurrent = tbCurrent.LogOnInfo With tliCurrent.ConnectionInfo .ServerName = "localhost" .UserID = "sa" .Password = "corbin" .DatabaseName = "BiWeekly" End With tbCurrent.ApplyLogOnInfo(tliCurrent) Next tbCurrent viewer.ReportSource = oRpt Catch ex As Exception MsgBox(ex.Message) Finally Me.Cursor = Cursors.Default End Try
The errors are saying:
Cannot find custom tool 'CrystalDecisions.VSDesigner.CodeGen.ReportCodeGenerator' on this system.
Name 'viewer' is not declared
Name 'strTransaction' is not declared.
Type 'CrystalDecisions.CrystalReports.Engine.Table' is not defined
Type 'CrystalDecisions.Shared.TableLogOnInfo' is not defined
Type 'ReportDocument' is not defined
I need some advice how to resolve these issues.
Thanks.




Reply With Quote