Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CRViewer and Memory Full Error

Status
Not open for further replies.

Theadmans

Programmer
Oct 23, 2006
35
GB
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 think I have solved my own problem now by moving the Form Unload above the CrxApp and CrxRpt statements.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top