cancel
Showing results for 
Search instead for 
Did you mean: 

CR9: Data retrieving

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Alias,

as you refer to the legacy technology VB6 I recommend to post this query to the [Legacy Application Development SDKs|; forum.

This forum is dedicated to topics related to legacy SDKs, including the Report Designer Component (RDC), OCX, VCL, and Crystal Reports Print Engine (CRPE).

It is monitored by qualified technicians and you will get a faster response there.

Also, all Legacy Application Development SDKs queries remain in one place and thus can be easily searched in one place.

Thanks a lot,

Falk

Former Member
0 Kudos

Hi there Falk.

Thank for the legacy forum recommendation.

for sure I will post my question there.

Best Regards,

Alias

Answers (0)