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

Formatting Negative Numeric Text Values 1

Status
Not open for further replies.

mwake

Programmer
Feb 12, 2004
151
US
I'm using CR 2008 with an Oracle 11G db as my data source. I have a requirement to format all negative values in red and using parentheses instead of a negative(-)sign. This is easy to accomplish with numeric fields, but I'm having problems with numeric text fields when displaying the report in Infoview. I have an existing numeric text formula:

If ({COMPSTATEMENT.T1OBJUNITTYPE2} = "PERCENT") Then
ToText({COMPSTATEMENT.T1OBJVALUE2} * 100) + "%"
else
if {@F_Territory1Measure}="Qualified Leads" then ToText({COMPSTATEMENT.T1OBJVALUE2},0)else
ToText({COMPSTATEMENT.T1OBJVALUE2})

If the value returned is negative, the formatting defaults to the setting in the Options menu in CR. I changed it to the desired format, and now I see it displaying negative values correctly. However, if I upload it into Infoview, it uses the CMC default which is a negative sign. Is there any way to modify my formula to get the correct formatting so it will display correctly in Infoview?? Or how do I change the default numeric formatting in the CMC??
 
Why do you need to convert them to text? If it's just for the "%" sign, there's a way to keep it as a number:

1. Rewrite your formula to return numbers - ignore the "%" for now.

2. Right-click on the formula after you put it in the report and go to "Format..."

3. On the Number tab, click on Customize.

4. Go to the Currency tab. Turn on "Enable Currency Symbol".

5. Click on the formula button to the right of the Enable Currency Symbol and put in something like the following formula:

If ({COMPSTATEMENT.T1OBJUNITTYPE2} = "PERCENT") Then crFixedCurrencySymbol
else crNoCurrencySymbol

6. Set the position of the symbol to be to the right of the number.

7. Set the symbol to "%".

This will get your percent sign when it's needed. You can now set the accounting format on the Number tab of the Custom Style and the text color on the font tab of the Format Editor.

-Dell




DecisionFirst Technologies - Seven-time SAP BusinessObjects Solution Partner of the Year
 

Percentages, currency, scientific notation, date/time...

...they are all PURE NUMBERS that can be DISPLAY FORMATTED, and that FORMATTING does absolutely nothing to the underlying numeric value.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top