Hello,
I have simple question regarding visual basic and crystal reports. I am using Crystal Reports 6 Professional and visual basic 6 professional. I have the follwing snippet of code which compiles and runs however there is one problem. When the report is opened for preview by the visual basic app, it is immediately(and automatically) closed again; the user does not have a chance to preview it.
Private Sub Command1_Click()
Dim crpApplication As CRPEAuto.Application
Dim crpReport As CRPEAuto.Report
Set crpApplication =CreateObject("crystal.crpe.application")
Set crpReport = crpApplication.OpenReport("C:\rep1.rpt")
crpReport.Preview
End sub
Any help would be much appreciated.
I have simple question regarding visual basic and crystal reports. I am using Crystal Reports 6 Professional and visual basic 6 professional. I have the follwing snippet of code which compiles and runs however there is one problem. When the report is opened for preview by the visual basic app, it is immediately(and automatically) closed again; the user does not have a chance to preview it.
Private Sub Command1_Click()
Dim crpApplication As CRPEAuto.Application
Dim crpReport As CRPEAuto.Report
Set crpApplication =CreateObject("crystal.crpe.application")
Set crpReport = crpApplication.OpenReport("C:\rep1.rpt")
crpReport.Preview
End sub
Any help would be much appreciated.