Skip to Content

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

CR9: Data retrieving

Greetings.

My name is Alias.

I have some issue. For the background, I am using VB6 and created reports using CR9. The database is mdb.

The problem is once I click a button to retrieve the report(invoicing), only the format is appeared without the data, eventhough the data is inside mdb. Then I click Refresh button many times..finally the data is appeared.

I am not very sure what to do. Please help me.

<<This is the coding that I use>>

Private Sub Form_Load()

On Error GoTo ErrorHandler

Dim conn As ADODB.Connection 'CONNECTION TO BROKER QUERIES

Dim rs As ADODB.Recordset 'HOLDS ALL DATA RETURNED FROM QUERY

Dim crystal As CRAXDRT.Application 'LOADS REPORT FROM FILE

Dim Report As CRAXDRT.Report 'HOLDS REPORT

CRView.DisplayBorder = False 'MAKES REPORT FILL ENTIRE FORM

CRView.DisplayTabs = False 'THIS REPORT DOES NOT DRILL DOWN, NOT NEEDED

CRView.EnableDrillDown = False 'REPORT DOES NOT SUPPORT DRILL-DOWN

CRView.EnableRefreshButton = True

Set conn = New ADODB.Connection

conn.CursorLocation = adUseClient 'SERVER-SIDE NOT RECCOMENDED

Set conn = GetConnection(0) ' set connection to the connection module

Set crystal = New CRAXDRT.Application 'MANAGES REPORTS

If frmInvoice.StatusBar.Panels(1).Text = "invepj_noremarks_gross" Then

Set Report = crystal.OpenReport("c:\epjlist\cr9\invepj_noremarks_gross.rpt")

frmsqlrpt.Caption = "Invoice('No' Remarks 'Yes' Gross)"

ElseIf frmInvoice.StatusBar.Panels(1).Text = "invepj_remarks_nogross" Then

Set Report = crystal.OpenReport("c:\epjlist\cr9\invepj_remarks_nogross.rpt")

frmsqlrpt.Caption = "Invoice('No' Gross 'Yes' Remarks)"

ElseIf frmInvoice.StatusBar.Panels(1).Text = "invepj_remarks" Then

Set Report = crystal.OpenReport("c:\epjlist\cr9\invepj_remarks.rpt")

frmsqlrpt.Caption = "Invoice('Yes' Gross 'Yes' Remarks)"

ElseIf frmInvoice.StatusBar.Panels(1).Text = "invepj_nogross" Then

Set Report = crystal.OpenReport("c:\epjlist\cr9\invepj_nogross.rpt")

frmsqlrpt.Caption = "Invoice('No' Gross 'No' Remarks)"

Report.Database.SetDataSource rsData

Report.DiscardSavedData

End If

CRView.ReportSource = Report 'LINK VIEWER TO REPORT

CRView.ViewReport 'SHOW REPORT

Do While CRView.IsBusy 'ZOOM METHOD DOES NOT WORK WHILE

DoEvents 'REPORT IS LOADING, SO WE MUST PAUSE

Loop 'WHILE REPORT LOADS.

CRView.Zoom 100

Set Report = Nothing

Set crystal = Nothing

Set rsData = Nothing

Set connStock = Nothing

Exit Sub

ErrorHandler:

MsgBox Err.description, vbInformation, "EPJLIST"

End Sub

Best regards,

Alias

Former Member
Not what you were looking for? View more on this topic or Ask a question