You need to format the color using the OBJECT itself. After you build you formula, place it in the report...then ...right-click on it...and choose FORMAT FIELD >>> FONT >>> COLOR... then use a formula to tell Crystal what color to use when a certain TEXT appears.

MikeV

0

marandrobAuthor Commented: 2008-01-29

IIF ({statementdata.Med Coverage}=0,"You have elected not to participate in the Un-Reimbursed Medical Account (URM)","You habe elected to participate in the Un-Reimbursed Medical Account (URM) in the amount of $" & {statementdata.Med Coverage} & "." )

The actual formula is above and I only nees {statementdata.Med.coverage} to be a different color - I need the rest of the text to be black and that one thing to be Navy Blue.

Read my above recommendation. Place the above formula into the report....THEN... RIGHT-CLICK the formula to activate the options menu...thend do the above...you need to assign a FORMULA...to the COLOR setting...for the OBJECT ITSELF....

You will have tp split the formula field into bits so that you can format the amount separately rom the rest of the text.
So you need one formula to produce the text and a second formula to produce an amount(converted to text using Cstr() or ToText() ) or blank result.
You can then format the second formula field as red, since an empty value will show no colour.

0

marandrobAuthor Commented: 2008-01-29

I am in the formula format editor - font color I put the following if {statementdata.HCSA} >0 then crNavy else crBlack - I want {statementdata.HCSA} to be navy is it is > 0 and black if it is 0 - I guess this is t the way to accomplish thi since it is always black.

0

marandrobAuthor Commented: 2008-01-29

Also it is fine to add the second field at the end but what if the text that I need a different color is in the middle of a comment and there can be various different comments with different things that need to be different colors?

I'm getting lost I'm afraid.
The question is changing each time you post.
I think you should repost and ask the question you want answering.

0

marandrobAuthor Commented: 2008-01-29

The question I have is - In the following formula how do I make the data item before the period and only the data item before the period Navy blue (within the text of the formula)?

IIF ({statementdata.Med Coverage}=0,"You have elected not to participate in the Un-Reimbursed Medical Account (URM)","You habe elected to participate in the Un-Reimbursed Medical Account (URM) in the amount of $" & {statementdata.Med Coverage} & "." )

I think I'm understanding what you need,..but...you are misunderstanding "HOW" Crystal works in regard to CONDITION COLOR FONT for FIELDS.

It sounds like you are trying to "conditionally" format the COLOR of the RESULT of your formula.

IF this is true....YOU CANNOT DO IT WITHIN THE ORIGINAL FORMULA IN CRYSTAL.

Crystal formats the FONT COLOR ...during the PRINTING phase. SO....what you need to do is create your FIELD FORMULA so as to provide the TEXT RESULTS you desire....THEN....add that formula FIELD to your report...wherever you want it to appear. NOW run your report. The TEXT will be the DEFAULT BLACK color. NO PROBLEM....ok....NOW.... rightCLICK the field in question....to OPEN the FORMATTING MENU.

CHOOSE: FORMAT FIELD >>> FONT >>> COLOR

Then go to the FORMULA BUTTON that has the "X-2" on it....this will take you to a FORMULA EDITOR.

NOW...you need to tell Crystal WHAT COLOR to format the field...when certain TEXT appears in the field.

IF({Yourtable.field})= "THIS TEXT" then crRED
Else crBlack

Something like this.....

MikeV

0

marandrobAuthor Commented: 2008-01-29

But won't this solution make all the text the alternate color not just one part of the text - I need to make just part of the resulting text a different color.

Ok..then I added BOTH formulas SEPARATELY to the report somewhere....doesn't matter where... just put them in the GROUP FOOTER...somewhere. You only need them so that you can FORMAT the conditional formula (FORMULA2).

Ok...THEN...rightclick on FORMULA2...and go to ....FORMAT FIELD >>> FONT >>> COLOR
Then click the X-2 button...and enter your formula to CONDITIONALLY SET the COLOR.

Something like this:

IF {@ConditionalFormat} = "Specific Text" then crRED else crBLACK

then OK..and close...

Now...then...the formula itself should show the correct color. So RightCLick FORMULA2....and COPY......then RIGHTCLICK FORMULA1 and paste FORMULA2 INSIDE FORMULA1..whereever you want it to display....

Oh well.......dang.... I didn't notice but it originally appeared that my FORMULA2 was inserted into FORMULA1's result.

Now I just noticed that it was NOT inserted...but simply pasted next to FORMULA1...which gives the appearance that it is a part of FORMULA1.

I'm not sure if this will work...It might.....if your two formulas can ACT in tandem.....separate from each other...but only DISPLAY in the same area.....so as to give the appearance of a single field..
MikeV

Here is a actually a solution that you can do in one formula.
You can set your formula up with html tags like this:

If {@test} > 0
then "This is a test"
else "This is not a test <font color='red'>" & {@test} & "</font>."

Place the formula on the report, right click it, and choose Format Field.
Under the Paragraph tab, change text interpretation to HTML.
Preview the report and the tags should be gone and the field in between the tags should be red.