this is the code i'm using to display Crystal report 9.0 from my VB 6 code :
Private Sub Form_Load()
Dim crystal As CRAXDRT.Application
Dim report As CRAXDRT.report
Dim vFilter as string
vFilter = "Finance"
CRViewer.DisplayBorder = False 'MAKES REPORT FILL ENTIRE FORM
CRViewer.DisplayTabs = False 'THIS REPORT DOES NOT DRILL DOWN, NOT NEEDED
CRViewer.EnableDrillDown = False 'REPORT DOES NOT SUPPORT DRILL-DOWN
CRViewer.EnableRefreshButton = False 'ADO RECORDSET WILL NOT CHANGE, NOT NEEDED
CRViewer.EnableCloseButton = True
Set crystal = New CRAXDRT.Application 'MANAGES REPORTS
Set report = crystal.OpenReport(rep_name) 'OPEN OUR REPORT
report.DiscardSavedData 'CLEARS REPORT SO WE WORK FROM RECORDSET
'report.Database.SetDataSource rs 'LINK REPORT TO RECORDSET
CRViewer.ReportSource = report 'LINK VIEWER TO REPORT
CRViewer.Height = Me.Height
CRViewer.Width = Me.Width
CRViewer.ViewReport 'SHOW REPORT
End Sub
The problem is i don't know how to include the vFilter variable to the report so the report will only display all the records field that match with vFilter value.
Private Sub Form_Load()
Dim crystal As CRAXDRT.Application
Dim report As CRAXDRT.report
Dim vFilter as string
vFilter = "Finance"
CRViewer.DisplayBorder = False 'MAKES REPORT FILL ENTIRE FORM
CRViewer.DisplayTabs = False 'THIS REPORT DOES NOT DRILL DOWN, NOT NEEDED
CRViewer.EnableDrillDown = False 'REPORT DOES NOT SUPPORT DRILL-DOWN
CRViewer.EnableRefreshButton = False 'ADO RECORDSET WILL NOT CHANGE, NOT NEEDED
CRViewer.EnableCloseButton = True
Set crystal = New CRAXDRT.Application 'MANAGES REPORTS
Set report = crystal.OpenReport(rep_name) 'OPEN OUR REPORT
report.DiscardSavedData 'CLEARS REPORT SO WE WORK FROM RECORDSET
'report.Database.SetDataSource rs 'LINK REPORT TO RECORDSET
CRViewer.ReportSource = report 'LINK VIEWER TO REPORT
CRViewer.Height = Me.Height
CRViewer.Width = Me.Width
CRViewer.ViewReport 'SHOW REPORT
End Sub
The problem is i don't know how to include the vFilter variable to the report so the report will only display all the records field that match with vFilter value.