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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Current date as default for parameter not working. 2

Status
Not open for further replies.

MrBillSC

Programmer
Aug 6, 2001
592
US
We are currently moving from vers 8.5 to 9.0. In version 8.5 date parameters always defaulted to the current date and showed the current date in the parameter discrete value box. The user did not have to enter anything if they wanted the current date as their parameter response. They simply clicked "OK" and the report ran fine.

After upgrading the reports to vers 9.0, the current date still appears in the discrete value box as the default value, but if the user simply clicks "OK" and does not select a date or at least place their cursor in the discrete value box, Crystal does not use the default date and the date prompt appears as Null in the page header.

Can anyone shed some light on this for me?
 
There are differences, and other differences when passing parameters from external applications, so code for it as in:

if isnull({?MyDateParm}) then
cdate(0,0,0)//adjust to your default date
else
{?MyDateParm}

You might need to do the same for your record selection formula.

-k
 
I could code for it as you suggested, but to me it seems that this is a bug - the default date (current date) shows in the discrete value window, but the report does not use this date unless you click in the discrete value window. If your date prompt is the first parameter, there is no problem because your cursor is in the value window for the first parameter, but not for subsequent parameters. Does anyone know if this has been fixed in service packs or other releases? Has anyone else experienced this?

Thanks -k for your response.

MrBill
 
MrBill,

I can confirm you are not dreaming. I had to code my way around this in my viewer application by using an ini file option (Set_Date_Parameters_Default_To_Today) that assigns today as the default if a discrete single-value Date or DateTime parameter has no default value. You could do the same if you create your own application.

If you are using Crystal 9 to run the reports, I'm not aware of a fix or a planned fix for this issue. They probably see it as a "feature"...

Cheers,
- Ido

Visual CUT & DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top