Results 1 to 3 of 3

Thread: [RESOLVED] Load a Report Programmatically

Threaded View

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2005
    Location
    Madison, WI
    Posts
    136

    Resolved [RESOLVED] Load a Report Programmatically

    I got this code from a book but there are errors all over this:

    VB Code:
    1. Me.Cursor = Cursors.WaitCursor
    2.  
    3.         Try
    4.             Dim oRpt As New ReportDocument
    5.             oRpt.Load("..\Reports\" & strTransaction)
    6.             Dim tbCurrent As CrystalDecisions.CrystalReports.Engine.Table
    7.             Dim tliCurrent As CrystalDecisions.Shared.TableLogOnInfo
    8.  
    9.             For Each tbCurrent In oRpt.Database.Tables
    10.                 tliCurrent = tbCurrent.LogOnInfo
    11.                 With tliCurrent.ConnectionInfo
    12.                     .ServerName = "localhost"
    13.                     .UserID = "sa"
    14.                     .Password = "corbin"
    15.                     .DatabaseName = "BiWeekly"
    16.                 End With
    17.                 tbCurrent.ApplyLogOnInfo(tliCurrent)
    18.             Next tbCurrent
    19.             viewer.ReportSource = oRpt
    20.  
    21.         Catch ex As Exception
    22.             MsgBox(ex.Message)
    23.         Finally
    24.             Me.Cursor = Cursors.Default
    25.         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.
    Last edited by callydata; Oct 6th, 2005 at 10:03 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width