Solved

Crystal Reports UK/US Date Formatting

Posted on 2012-04-05
2
251 Views
Last Modified: 2012-08-14
One of our UK clients has asked for currency and date formats (UK format) on their reports. Crystal Reports 9 and we literally have dozens of reports we'd need to change.

We need to maintain the option to display the US date format on all reports but won't consider maintaining two different versions of each report.

Can formulas be used in Crystal 9 to format a date field - based on a db value passed to the report or otherwise?
0
Comment
Question by:neekolzun
2 Comments
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
Comment Utility
Sure.

Try this

Right click the field
Click FORMAT FIELD
Select the NUMBER TAB
Click CUSTOMIZE
Clcik the CURRENCY SYMBOL tab
Click the formula butoon to the right of Currency Symbol
Enter a formula like

if {?Country} = "England" then
   chr(ASCII for pound or euro symbol)
Else
   "$"

mlmcc
0
 
LVL 34

Expert Comment

by:James0628
Comment Utility
I haven't use CR 9, but CR 10 has "System Default" format options for numeric and date fields.  If CR 9 has them, they might be worth a look.  Otherwise, you can probably handle it using formatting formulas, as in mlmcc's example.  For a date field, open the format window, select the "Date and Time" tab, click Customize, select the Date tab, and click the formula (X+2) button under Order.  Your formula needs to produce 0 for YMD, 1 for DMY, or 2 for MDY, so it might be something like:

if {country} = "UK" then
  1  // DMY
else
  2  // MDY


 I'm using CR 10.  Hopefully CR 9 has the same options.

 If you want to apply the same formatting to several fields on a report, you can select all of the fields (hold Control or Shift and click, or drag a box around them, or right-click on a section name and "select all section objects"), and then right-click and select "Format Objects" and format all of them at once.

 James
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now