Results 1 to 4 of 4

Thread: Crystal Report

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2003
    Location
    India
    Posts
    318

    Crystal Report

    Hi,

    I am totally new to Crystal reporting. I even don't know how to add a report to a VB program. I hope somebody will help me on this.

    I have a main form with a command button called Report. When this command button is clicked, I have another form with some option buttons to choose what type of report they want to view. When the OK button is clicked, the report should be displayed depending on the criteria the user opted. Can this be done? Please help.

    Thanks

  2. #2
    PowerPoster Pasvorto's Avatar
    Join Date
    Oct 2002
    Location
    Minnesota, USA
    Posts
    2,951
    Yes, it can be done.

    What level VB and what level CR?

  3. #3
    Hyperactive Member ARPRINCE's Avatar
    Join Date
    Mar 2003
    Location
    Pinoy in NJ
    Posts
    381
    I use the pull down menu of the MDIForm (Parent form). This will call a child form that has a grid with all my reports.

    User double clicks on the GRID on the report they want.
    VB Code:
    1. Private Sub dbgREPORTS_DblClick()
    2.    If adoRS.RecordCount > 0 Then
    3.       REPORT_DIR = App.Path & adoRS.Fields(1)  '-- REPORT_DIR is a global variable
    4.       frmREPORTVIEW.Show
    5.    End If
    6. End Sub

    The report is rendered on another form.

    VB Code:
    1. Option Explicit
    2.  
    3. Dim crxApplication As New CRAXDRT.Application
    4. Dim crxReport As CRAXDRT.Report
    5.  
    6. Private Sub Form_Load()
    7.    Set crxApplication = New CRAXDRT.Application
    8.    Set crxReport = crxApplication.OpenReport(REPORT_DIR) '--Report name is passed here from the report menu form
    9.  
    10.    With crxReport.Database.Tables(1).ConnectionProperties
    11.       .Item("Provider") = "xxxxxxxx"
    12.       .Item("Data source") = "xxxxxxxx"
    13.       .Item("Initial Catalog") = "xxxxxx"
    14.       .Item("User ID") = "xxxxxxx"
    15.       .Item("Password") = "xxxxxxx"
    16.    End With
    17.    
    18.    
    19.    Dim CRXParamDefs As CRAXDRT.ParameterFieldDefinitions
    20.    Dim CRXParamDef As CRAXDRT.ParameterFieldDefinition
    21. '   crxReport.PrinterSetup (0) '<-- THIS BRINGS UP THE PRINTER DIALOGUE BOX
    22.  
    23.    CRViewer91.ReportSource = crxReport
    24.    CRViewer91.ViewReport
    25. End Sub
    26.  
    27. Private Sub Form_Resize()
    28.    With CRViewer91
    29.       .Top = 0
    30.       .Left = 0
    31.       .Width = Me.ScaleWidth
    32.       .Height = Me.ScaleHeight
    33.    End With
    34. End Sub
    35.  
    36. Private Sub Form_Unload(Cancel As Integer)
    37.    Set crxReport = Nothing
    38.    Set crxApplication = Nothing
    39. End Sub
    Attached Images Attached Images  

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2003
    Location
    India
    Posts
    318
    I use VB6 and CR10.

    Thanks

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