Results 1 to 4 of 4

Thread: Crystal Report

Threaded View

  1. #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  

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