crystal report help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ranesmitas
    New Member
    • Sep 2007
    • 21

    crystal report help

    hello,

    i using vb 6 and i did report seagate crystal report .
    i want to know how it use in vb . i did some code but it not display anything

    code is


    Public strReportPath As String
    Public strRecordSelect ion As String
    Dim crystal As New CRAXDRT.Applica tion
    Dim Report As New CRAXDRT.Report

    Private Sub Form_Load()
    strRecordSelect ion = ""
    strReportPath = App.Path & "\" & "Report1.rp t"

    On Error Resume Next
    Set crystal = New CRAXDRT.Applica tion
    Set Report = Nothing
    Set Report = crystal.OpenRep ort(strReportPa th)

    Report.Database .LogOnServer "pdsodbc.dl l", stud.mdb, sd

    If strRecordSelect ion <> "" Then
    Report.RecordSe lectionFormula = strRecordSelect ion

    End If
    Report.DiscardS avedData
    Cry.ReportSourc e = Report
    Cry.ViewReport
    Cry.Zoom 2
    Set crystal = Nothing

    end sub


    please tell why it not display report
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    if you are trying todisplay the CR iusing the CR viewer then

    Add a crystal report from under the projects menu.

    Create from the Crystal report file and save.

    then try the following code

    [CODE=vb]Public Sub MonthlyReportDi splay(Query As String)

    Set CRXReport = CrystalReport4
    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

    CrystalReport1. SQLQueryString = Query

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

    Set CRXReport = Nothing
    End Sub[/CODE]


    You can call this procedure from buttonclock by passing the querystring for the report. so that the report will be dynamic.

    Comment

    • ranesmitas
      New Member
      • Sep 2007
      • 21

      #3
      Thanks but how i can link external (seagate crystal report ) in vb
      please tell me.

      Comment

      • debasisdas
        Recognized Expert Expert
        • Dec 2006
        • 8119

        #4
        Originally posted by ranesmitas
        Thanks but how i can link external (seagate crystal report ) in vb
        please tell me.
        You need to

        Add a crystal report in VB 6.0 from under the projects menu.

        Create the report from the external Crystal report file and save.

        then follow as suggested in the previous post.

        Comment

        Working...