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

UK format dates in Crystal 9

Status
Not open for further replies.

pastasalad

Programmer
Mar 27, 2003
38
GB
I am having problems getting a CR9 report to display dates in the format '21/09/2003'.

If I ask for 'System Default Short Format' then the date is displayed in US format: '09/21/2003'.

If I force the '01-Mar-1999' format, then it does successfully show '21-Sep-2003'. But this is not what the user wants to see. The user wants to see '21/09/2003'.

I have checked the Regional Options>Date setting, which is correctly showing Short Date Format as 'dd/MM/yyyy'.

Why won't CR9 let me use 'dd/mm/yyyy'? Has anybody been here before?
 
Oops. Forgot to mention that the date does display UK format in CR itself, but reverts to US format when viewed on a webserver, using the ActiveX viewer. And yes, I have checked the webserver date format. It is also dd/MM/yyyy.
 
Hi pastasalad,
I experienced something similar to this in v8.5, I had my regional settings set to the language I was developing in and the dates in my report were formatted correctly per this language, but in our ap it displayed in the US format instead of the correct format for the language. This is how we 'solved' it.

Go into Crystal and reformat your date type to different format & click OK. View your report to make sure the format changed. Now go back into the format editor and reset the date format to System Default Short Format & click OK. Now save your changes and then view it on your webserver. I'm not sure why the original settings weren't displaying correctly in my ap but this solved the problem.

Another suggestion to try:
In the format editor for this field, try setting the Order of the date to DMY. This will cause your date type to change from System Default Short Format to Custom, but if nothing else works....
Jacque [morning]
 
In Crystal 8.5, you can go [File], [Options] and the [Field] tab, and set one arrangement to be the default for dates. Also for currency, number etc.

A point to watch is that these settings may not apply to Crystal running on another machine.

Madawc Williams
East Anglia, Great Britain
 
The person viewing the report may have to adjust their "Windows" settings? Settings > Control Panel needs to be adjusted on the viewer's machine , perhaps? Not really certain about this, but we had a similar problem here just weeks ago...this technique fixed it!
 
Thanks for all the suggestions folks.

Here is what fixed it in the end:

The ASP pages have been written to save the parameter names and corresponding values in a cookie, and then read back the names and values from the cookie later on.

It turned out that it was during the period of time that dates were being stored in the cookie that the conversion to US format was being forced on them.

Phew! Took us a while to track that one down, having exhausted all the obvious and less obvious possibilities first. To fix it we forced the dates into ANSII format strings and stored them in that format in the cookie. Thus no conversion was forced onto the values in the cookie. Thus Crystal was able to understand them as UK format dates.

Thanks again for all the suggestions.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top