Formatting Number/Currency fields
Posted on 2008-09-30
I'm using Crystal Reports in Microsoft Visual Studio 2005. The report I am working on is part of a money-counting application. I have two copies of the Amount field, overlaid on each other. The first copy of the Amount field is formatted with "System Default Number Format" selected on the Number tab. The second copy of the Amount field is formatted with "Custom Style" selected on the Number tab, and then the Custom Styles|Number tab has specific settings for Decimals (1.0000), Rounding (0.0001), and Negatives. The first copy is suppressed if exchange rates are used; the second copy is suppressed if exchange rates are not used. (If exchange rates are used, I want the Amount field to have 4 decimal places.)
Here's what I am trying to accomplish, and the associated questions:
1. The first copy of the Amount field should always reflect the Regional Settings in Windows Control Panel. I think I've done this by setting System Default Number Format. However, when I go back into the Format Editor, System Default Number Format is no longer selected -- Custom Style is. Why is it getting changed? (Despite the change, the first copy of this field at runtime in the viewed report seems to correctly reflect the Regional Settings selection.)
2. I want the second copy of the Amount field to reflect Regional Settings too, but with 4 decimal places, a rounding of .0001, and negatives shown according to Regional Settings. From a post I found in this forum, and from my testing, I gather that I forfeit the field's ability to reflect Regional Settings because I selected Custom Style and made specific decimal, rounding and negative selections. Is this correct?
3. There is a checkbox titled "Use Accounting Format" on the Custom Styles|Number tab, and the MSDN help for this says "When you select this option, the negative symbol used and its position is determined by the Windows Regional Settings (it will be either the minus sign or the brackets)." I was hoping this means that the report field when viewed at runtime will reflect Regional Settings for negatives, but what I think it actually means is that the Negatives setting shown in the Crystal Format Editor|Custom Style|Number tab reflect your Regional Settings at the time. Can you confirm?
4. Can you think of any way that I can make the second copy of the Amount field reflect all Regional Settings except show four decimal places?