Hi,
I am fairly new to Crystal and am trying to covert our VB 6.0 Application to load Crystal Reports from .Rpt files instead of Crystal Designer (DSR/DSX) Files. We use Crystal 8.0
I have cobbled together the following code which works on the first run of the report. However, if I try to run it a second time (whilst the first copy of the report is still on the screen) then I get "CRViewer Memory is Full". Here is my code :-
Dim crxApp As New CRAXDRT.Application
Dim crxRpt As CRAXDRT.Report
Set crxRpt = crxApp.OpenReport(App.Path & "\Reports\MyReport.rpt")
Unload FrmReport
Fxload FrmReport, True
Screen.MousePointer = vbHourglass
On Error Resume Next
crxRpt.Database.Tables(1).SetLogOnInfo "ServerOrDNSName", "DBName", "UserId", "Password"
FrmReport.CRViewer.ReportSource = crxRpt
FrmReport.CRViewer.ViewReport
Do While FrmReport.CRViewer.IsBusy
DoEvents
Loop
Set crxRpt = Nothing
On Error GoTo 0
Interestingly if I click on a menu item that has nothing to do with Crystal that loads and then I can load another copy of my report. I guess I am doing something wrong in not unloading the CRViewer.
Has anybody got any ideas it is driving me mad!!
I am fairly new to Crystal and am trying to covert our VB 6.0 Application to load Crystal Reports from .Rpt files instead of Crystal Designer (DSR/DSX) Files. We use Crystal 8.0
I have cobbled together the following code which works on the first run of the report. However, if I try to run it a second time (whilst the first copy of the report is still on the screen) then I get "CRViewer Memory is Full". Here is my code :-
Dim crxApp As New CRAXDRT.Application
Dim crxRpt As CRAXDRT.Report
Set crxRpt = crxApp.OpenReport(App.Path & "\Reports\MyReport.rpt")
Unload FrmReport
Fxload FrmReport, True
Screen.MousePointer = vbHourglass
On Error Resume Next
crxRpt.Database.Tables(1).SetLogOnInfo "ServerOrDNSName", "DBName", "UserId", "Password"
FrmReport.CRViewer.ReportSource = crxRpt
FrmReport.CRViewer.ViewReport
Do While FrmReport.CRViewer.IsBusy
DoEvents
Loop
Set crxRpt = Nothing
On Error GoTo 0
Interestingly if I click on a menu item that has nothing to do with Crystal that loads and then I can load another copy of my report. I guess I am doing something wrong in not unloading the CRViewer.
Has anybody got any ideas it is driving me mad!!