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

Date Formatting Issue

Status
Not open for further replies.

jakecolman

IS-IT--Management
Apr 2, 2006
54
US
Using Crystal Reports XI with Oracle 9.

The format in which dates appear (e.g., MM/DD/YY or DD-MON-YYYY) can be configured using "File/Options/Fields" and then specifying the format for 'Date' and 'Date and Time'. This works fine for all fields EXCEPT for parameter fields. If I have a user-specifiable parameter that is a Date parameter, and I include that parameter on the printed report, the format of that date value is hard-wired to the format in effect when the field was placed. It does not seem to honor the setting specified as above.

Am I missing something here? Does anyone else see this problem? Can anyone suggest a workaround?

Thanks!

...Jake
 
right click the parameter field where it is printed on your report and select "format field". Then format anyway you like.

MrBill
 
I don't want my user to have to modify the report itself nor do I want to hard-wire a format. I just want the user to specify his preferred formatting option via the menu and all dates should be consistently formatted the same way when the report is executed. This works for all dates BUT date parameters.
 
Your issue is not clear. Date parameters can be formatted in the same way as any other date. Have you set up some functionality where the user selects the date format and all date fields are then formatted this way? If so, how did you go about this?

-LB

 
I didn't set up my own functionality; I use Crystal's File/Options menu to specify how I want to see all dates on the report. If another user brings up the .rpt file in his instance of Crystal, and he has a different default date format specified, all the dates on the report should honor his format. And all the dates do - except for date parameters. If I change the default setting, all the dates switch to the new format the next time I execute the report. Date parameters, however, do not.

Does the above explain what I'm trying to do and what I'm seeing?
 
Hmm. I just changed the default setting in the Options tab for date and it didn't change the formatting for anything, since the field I was working with was a datetime, but when I changed the format for datetime, both fields and date parameters (set to date or datetime) changed to the new format (M/d/yy).

The only place it doesn't change is on the parameter selection screen.

-LB
 
Hmmm. And I found that if I display the parameter using the formula ToText(?Param) it works fine. Arfe you saying that Date parameters honored the setting even without this?

Just to be clear, when you add the parameter to the design view it will display using your selected format. Save the .rpt, exit, reedit the .rpt and changed the format to some other type. Now when you regenerate the report, all dates but the parameter will reflect the new setting. The parameter will retain the setting in effect when it was added to the report.

Can you confirm that you are seeing this same misbehavior? or is it working correctly for you?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top