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:
Private Sub dbgREPORTS_DblClick() If adoRS.RecordCount > 0 Then REPORT_DIR = App.Path & adoRS.Fields(1) '-- REPORT_DIR is a global variable frmREPORTVIEW.Show End If End Sub
The report is rendered on another form.
VB Code:
Option Explicit Dim crxApplication As New CRAXDRT.Application Dim crxReport As CRAXDRT.Report Private Sub Form_Load() Set crxApplication = New CRAXDRT.Application Set crxReport = crxApplication.OpenReport(REPORT_DIR) '--Report name is passed here from the report menu form With crxReport.Database.Tables(1).ConnectionProperties .Item("Provider") = "xxxxxxxx" .Item("Data source") = "xxxxxxxx" .Item("Initial Catalog") = "xxxxxx" .Item("User ID") = "xxxxxxx" .Item("Password") = "xxxxxxx" End With Dim CRXParamDefs As CRAXDRT.ParameterFieldDefinitions Dim CRXParamDef As CRAXDRT.ParameterFieldDefinition ' crxReport.PrinterSetup (0) '<-- THIS BRINGS UP THE PRINTER DIALOGUE BOX CRViewer91.ReportSource = crxReport CRViewer91.ViewReport End Sub Private Sub Form_Resize() With CRViewer91 .Top = 0 .Left = 0 .Width = Me.ScaleWidth .Height = Me.ScaleHeight End With End Sub Private Sub Form_Unload(Cancel As Integer) Set crxReport = Nothing Set crxApplication = Nothing End Sub




Reply With Quote