BJ JMU
12-22-2003, 08:44 AM
I have been searching and trying many different things to run a crystal report from vb6.0. here is my code as of now:
-----------------------------------------------------------------
Dim crxApp As CRAXDRT.Application
Dim crxReport As CRAXDRT.Report
Dim CRViewer As CRViewer9
Set crxApp = CreateObject("crystalruntime.application")
Set crxReport = crxApp.OpenReport("\\Report Path\ReportName.RPT")
crxReport.Database.Tables(1).SetLogOnInfo "ServerName", "DatabaseName", "UserName", "Password"
Screen.MousePointer = vbHourglass
***CRViewer.ReportSource = crxReport
CRViewer.ViewReport
Screen.MousePointer = vbDefault
----------------------------------------------------------------
I am getting a run-time error '91'
object variable or with block variable not set
and that points me to the line with the ***'s
can anyone see what i'm doing wrong?
-----------------------------------------------------------------
Dim crxApp As CRAXDRT.Application
Dim crxReport As CRAXDRT.Report
Dim CRViewer As CRViewer9
Set crxApp = CreateObject("crystalruntime.application")
Set crxReport = crxApp.OpenReport("\\Report Path\ReportName.RPT")
crxReport.Database.Tables(1).SetLogOnInfo "ServerName", "DatabaseName", "UserName", "Password"
Screen.MousePointer = vbHourglass
***CRViewer.ReportSource = crxReport
CRViewer.ViewReport
Screen.MousePointer = vbDefault
----------------------------------------------------------------
I am getting a run-time error '91'
object variable or with block variable not set
and that points me to the line with the ***'s
can anyone see what i'm doing wrong?