on 09-22-2008 1:26 AM
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
See if when you load the report before you set any viewer properties helps. E.g.; load ther report, then set the recordset, then set the viewer properties, view report.
Ludek
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.