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!

Closing CRViewer

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 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!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top