You may want to pass date or date range information from your Visual Basic application to the Crystal Report Engine for use in formulas, selection formulas, etc. Here is an example showing a way to do it successfully:
JobHandle% = PEOpenPrintJob ("C:\CRW\CUSTOMER.RPT")
StartYear$ = 1992
StartMonth$ = 01
StartDay$ = 01
EndYear$ = 1993
EndMonth$ = 12
EndDay$ = 31
StrtSelect$ = "{filea.STARTDATE} < Date
(" + StartYear$ + ", " + StartMonth$ + ", "
+ StartDay$ +")"
EndSelect$ = "{filea.ENDDATE} < Date
(" + EndYear$ + ", " + EndMonth$ +
", " + EndDay$ +")"
Recselct$ = StrtSelect$ + " AND " + EndSelect$
RetCode% = PESetSelectionFormula
(JobHandle%, RecSelect$)
RetCode% = PEStartPrintJob (JobHandle, 1)
RetCode% = PEClosePrintJob (JobHandle, 1)
| Seagate Software IMG Holdings, Inc. http://www.seagatesoftware.com Support services: http://support.seagatesoftware.com |