Hi,
I posted this in the Crystal Integration Forum yesterday but got no replies - so I am hoping that some kind person may see it here instead! Here goes:-
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 another Report (whilst the first report is still on the screen) then I get "CRViewer Memory is Full". Here is my code :-
Unload FrmReport
Fxload FrmReport, True
Dim crxApp As New CRAXDRT.Application
Dim crxRpt As CRAXDRT.Report
Set crxRpt = crxApp.OpenReport(App.Path & "\Reports\MyReport.rpt")
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
I guess I am doing something wrong in not closing the CRViewer. How can I close the CRViewer when the next report is requested or is there a different problem with my code?
Has anybody got any ideas it is driving me mad!!
I posted this in the Crystal Integration Forum yesterday but got no replies - so I am hoping that some kind person may see it here instead! Here goes:-
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 another Report (whilst the first report is still on the screen) then I get "CRViewer Memory is Full". Here is my code :-
Unload FrmReport
Fxload FrmReport, True
Dim crxApp As New CRAXDRT.Application
Dim crxRpt As CRAXDRT.Report
Set crxRpt = crxApp.OpenReport(App.Path & "\Reports\MyReport.rpt")
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
I guess I am doing something wrong in not closing the CRViewer. How can I close the CRViewer when the next report is requested or is there a different problem with my code?
Has anybody got any ideas it is driving me mad!!