A Simple Crystal Report problem
Hi,
I am using Crystal Reports (8.0) for the first time (started the day before only). I have problem viewing the report in VB6.
The code is short:
Option Explicit
Public conn As ADODB.connection
Private Sub Command1_Click()
CrystalReport.ReportFileName = "C:\XX\Report1.rpt"
CrystalReport.Action = 1
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Call Connect
End Sub
Public Sub Connect()
Set conn = New ADODB.connection
conn.ConnectionString = "DSN=xx;UID=yyy;PWD=zzz;"
With conn
.ConnectionTimeout = 3
.CursorLocation = adUseClient
End With
conn.Open
End Sub
Followings have been included:
Project>References: 1. CrystalReport Viewer Control
Project>Components: 1. CrystalReport Control
2. Crystal report Viewer Control
The error message I am getting at line:
CrystalReport.ReportFileName = "C:\XX\Report1.rpt"
Comile error
Variable not defined
Apart from two Command buttons, the Form has just a CRViewer that is stretched to cover most part of the form. Running the .rpt under CR connects with Oracle and displays headings/data from the table properly but does not work with VB. Obviusly, I must be making some mistake somewhere.
Please help.
TIA.
-Vivek