Skip to Content
avatar image
Former Member

Crystal Report Viewer "Memory Full" Error

CR Version: 9.2 (No Service packs)

OS: Windows XP Pro SP2

Dev Platform: VB6

DB: SQL Server 2000

I am getting a Memory Full error randomly while viewing the report. Managed to narrow down the function (vb code) at which the error is triggered but I am not able to figure out a solution.

THE ERROR OCCURS WHEN Load frmCRView is called for the THIRD TIME in the Function ProcessInNewDesigner

I hope I was able to put my problem down here...

Appreciate any Help here.

Thanks & Regards,

Arull Prakash

Function ProcessInNewDesigner() As Boolean

' 'Include error handler later.

g_blnNewReportProcessed = False

g_intPassNumber = 1

g_blnLastPageReached = False

Load frmCRView

Unload frmCRView

Set frmCRView = Nothing

'Other data process code..... updation to db

g_intPassNumber = 2

g_blnLastPageReached = False

Load frmCRView_New

Unload frmCRView_New

DoEvents

Set frmCRView = Nothing

'Other data process code..... updation to db

g_intPassNumber = 3

g_blnLastPageReached = False

Load frmCRView

Unload frmCRView

DoEvents

Set frmCRView = Nothing

Call After_Designer_Updations()

'Other code here.....

End Function

Private Sub frmCRView_Load()

Call subProcessReport

End Sub

Private Sub subProcessReport()

Dim Final_Rpt As New CrystalReportDesigner1

If GlobalSQLMode = 0 Then

Final_Rpt.Database.Tables(1).SetLogOnInfo ServerName, Final.DefaultDatabase

Else

Final_Rpt.Database.Tables(1).SetLogOnInfo ServerName, Final.DefaultDatabase, "sa", GlobalSQLsaPwd

End If

Final_Rpt.SQLQueryString = gPSQL

Final_Rpt.DiscardSavedData

Final_Rpt.Database.Verify

CRViewer1.ReportSource = Final_Rpt

CRViewer1.ViewReport

Dim iPages As Integer

Call CRViewer1.ShowFirstPage

Dim iTotalPages As Integer

For iPages = 1 To 1000 ' iTotalPages

DoEvents

Call CRViewer1.ShowNthPage(iPages)

DoEvents

If g_intPassNumber = 1 Then

' Custom code here....

ElseIf g_intPassNumber = 2 Then

' Custom code here....

Else

-- ERROR IS TRIGGER HERE ---

' Custom code here....

End If

If g_blnLastPageReached Then Exit For

Next iPages

Call CRViewer1.ShowFirstPage

Set Final_Rpt = Nothing

Exit Sub

End Sub

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer