Crystal Report 8.5 and Visual Basic 6.0 Problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MarkTingson
    New Member
    • Nov 2007
    • 40

    Crystal Report 8.5 and Visual Basic 6.0 Problem

    Hello guys,

    I am having a difficult time connecting VB6 to CR 8.5... I have tried adding Crystal report 8.5 in my project and use it as a designer tool.. i am successful designing the report, here's my question...

    1. How can i view my report?
    2. is there any connection needed?
    3. before i did this, there is an error message saying: "Failed to add viewer".
    4. what could be the impact of this eror?
    5. does the error related to my problem in viewing the report?
    6. How can i get rid this error?

    Thanks guys!
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    add a crystla report viewer to the form

    try the sample code (this is for connection to Oracle)

    [code=vb]
    Public Sub ReportDisplay(Q uery As String)

    Set CRXReport = visitordetails
    Set CRXDb = CRXReport.Datab ase
    CRXReport.Disca rdSavedData

    inti = 1
    Do Until inti = CRXReport.Datab ase.Tables.Coun t + 1
    CRXReport.Datab ase.Tables.Item (inti).SetLogOn Info strdblocation, "das", "debasis", "debasis"
    inti = inti + 1
    Loop

    visitordetails. SQLQueryString = Query

    With FrmReport1
    .Show
    .CRV1.ReportSou rce = CRXReport
    .CRV1.ViewRepor t
    End With

    Set CRXReport = Nothing
    End Sub

    [/code]

    Comment

    • MarkTingson
      New Member
      • Nov 2007
      • 40

      #3
      Hi Sir,

      i forgot to tell you...My database back-end is MS Access...will this code work for me??

      Thanks,

      Comment

      • debasisdas
        Recognized Expert Expert
        • Dec 2006
        • 8119

        #4
        Please find a related discussion here.

        Comment

        • MarkTingson
          New Member
          • Nov 2007
          • 40

          #5
          Hi sir,

          Why is it that i can't find the .ViewReport, .EnableExportBu tton, .EnableCloseBut ton and .ReportSource??

          is there a problem with my .dll's?

          How can i solve this problem?

          Thanks!

          Comment

          • lotus18
            Contributor
            • Nov 2007
            • 865

            #6
            Originally posted by MarkTingson
            Hi sir,

            Why is it that i can't find the .ViewReport, .EnableExportBu tton, .EnableCloseBut ton and .ReportSource??

            is there a problem with my .dll's?

            How can i solve this problem?

            Thanks!
            I think you need to add a reference to it : )

            Rey Sean

            Comment

            • QVeen72
              Recognized Expert Top Contributor
              • Oct 2006
              • 1445

              #7
              Originally posted by MarkTingson
              Hi sir,
              Why is it that i can't find the .ViewReport, .EnableExportBu tton, .EnableCloseBut ton and .ReportSource??
              did you add "Crystal Viewer" Control to your form...?

              -Veena

              Comment

              • MarkTingson
                New Member
                • Nov 2007
                • 40

                #8
                Hehehe.. Thanks guys!

                whoooo!

                Comment

                Working...