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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Loading CR: "Memory Full" error (v8.5 + VB6)

Status
Not open for further replies.

term80r

Programmer
Jun 20, 2003
2
GB
I'm a newbie to crystal reports, who has been told by an evil boss that I must produce two crystal reports / vb interfaces for a distributed system with 20+ users by monday morning:(

I've managed to cobble together some code to load a report and print it. This works fine the first time, but comes up with a "Memory Full" error the SECOND time report is loaded.

I've attached the code below. Anyone got any ideas?

Private Sub cmdLoad_Click()

CRViewer.DisplayBorder = False 'MAKES REPORT FILL ENTIRE FORM
CRViewer.DisplayTabs = False 'THIS REPORT DOES NOT DRILL DOWN, NOT NEEDED
CRViewer.EnableDrillDown = False 'REPORT DOES NOT SUPPORT DRILL-DOWN
CRViewer.EnableRefreshButton = False 'ADO RECORDSET WILL NOT CHANGE, NOT NEEDED
Set crystal = New CRAXDRT.Application 'MANAGES REPORTS
Set report = crystal.OpenReport(App.Path & "\Shipping Manifest (Container Sequence).rpt") 'OPEN OUR REPORT

report.DiscardSavedData 'CLEARS REPORT
report.Database.Verify

report.ParameterFields(1).ClearCurrentValueAndRange 'Set up a parameter
report.ParameterFields(1).AddCurrentValue "V00001"

CRViewer.ReportSource = report 'LINK VIEWER TO REPORT
CRViewer.ViewReport 'SHOW REPORT << Fails here

Do While CRViewer.IsBusy 'ZOOM METHOD DOES NOT WORK WHILE
DoEvents 'REPORT IS LOADING, SO WE MUST PAUSE
Loop 'WHILE REPORT LOADS.

CRViewer.Zoom 94

End Sub



 
... the answer to my own problem is that if you change the code (line 6) to :

Set crystal = New CRAXDRT.Application 'MANAGES REPORTS
crystal.CanClose

It seems to work.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top