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