themaj
July 6th, 2006, 01:17 AM
I have created several reports that launch from VB6 with a simple command but do not rely on any dynamic input.
Now I need to add a date range query and although I think I got the query right, I'm really not sure what prep code I need to get it to work.
I guess I have to create an object and other 'things'. Besides Crystal ActiveX Report Viewer, are there any other components or dependencies required?
Am I getting close with this? It certainly isn't working right now.
Private Sub cmd_test_Click()
Set crxApp = New CRAXDRT.Application
Set crxRpt = crxApp.OpenReport(App.Path & "\Deliveries by Product Abbrev.rpt")
crxRpt.RecordSelectionFormula = "{transactions.TRANS_DATE} >= 20060600 and {transactions.TRANS_DATE} < 20060615"
crxApp.ReportSource = crxRpt
crxApp.ViewReport
End Sub
**Assume that the {transactions.TRANS_DATE} is being stored in the DB as a long integer so a 'date' of 20060600 would not be a valid date but it is a good marker as the beginning of June'06.
Obviously I'm new at this and any help to get this simple thing working would be greatly appreciated.
Now I need to add a date range query and although I think I got the query right, I'm really not sure what prep code I need to get it to work.
I guess I have to create an object and other 'things'. Besides Crystal ActiveX Report Viewer, are there any other components or dependencies required?
Am I getting close with this? It certainly isn't working right now.
Private Sub cmd_test_Click()
Set crxApp = New CRAXDRT.Application
Set crxRpt = crxApp.OpenReport(App.Path & "\Deliveries by Product Abbrev.rpt")
crxRpt.RecordSelectionFormula = "{transactions.TRANS_DATE} >= 20060600 and {transactions.TRANS_DATE} < 20060615"
crxApp.ReportSource = crxRpt
crxApp.ViewReport
End Sub
**Assume that the {transactions.TRANS_DATE} is being stored in the DB as a long integer so a 'date' of 20060600 would not be a valid date but it is a good marker as the beginning of June'06.
Obviously I'm new at this and any help to get this simple thing working would be greatly appreciated.