Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CR 8.5 Parameters 2 Questions

Status
Not open for further replies.

rsatty

Programmer
Nov 15, 2003
21
US
1.How can I set up a Date and Time Parameter to automatically set to yesterday's date and 12:00:00 AM?

2.Can I set up the report that when it is opened through a viewer or in design I automatically get a prompt to refresh the data?
 
I think that the answer to your question is to use a parameter and set the default value to something like 1/1/1970, then in the Report->Edit Record Selection->Record use:

If {?MyDateParm} = cdate(1970,1,1) then
{table.date} = currentdate-1
else
{table.date} = {?MyDateParm}

When the report is opened it will prompt for a date, which if they don't adjust it will default to yesterday, otherwise they can enter a date.

Unfortunately Crystal is VERY weak with regards to parameters, so to prompt intelligently you need external code (write something or use a 3rd party viewer).

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top