Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

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

Former Member
replied

SetLogOnInfo is deprecated, use the connection properties bag:

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/00635998-751e-2b10-9cba-f50ee1e4ef81

Also, ensure you are working with the latest CR Service pack. SPs are here:

https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/bobj_download/main.htm

Ludek

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question