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

How to specify "BOLD" font in a formula ? 1

Status
Not open for further replies.

boardburner

Technical User
Dec 23, 2003
77
US
I have looked & possibly missed it in help....but
how do I specify font formating in my formulas.?

Code:
if {@RawReqd}>{@RawAvailable}
//make bold
then crRed
//default font
else crBlack

Is it possible to callout other formating of fonts in formulas ?? If so where do I find the white papers/articles ??

Thanks
Gene
 
I haven't used it before, but you should be able to format it as HTML and then make all of the changes. Right-Click, Format Field, Paragraph Formatting, Text Interpretation, HTML Text.
 
Sorry...should have said I am in CR9
I think it might have an effect my answers.

Thanks
 
Good idea but I am working with numbers.......on option for paragraph.

Thanks
 
New formula:
Code:
if {@RawReqd}>{@RawAvailable} then
//make boldlable
"<font color=#FF0000><b>" & totext({@RawReqd} & "</b></font>"
//default font
else "<font color=#000000>" & totext({@RawReqd}) & "</font>"
 
While highlighting the same field/formula and while you are in the font screen where you have formatted the color for the field/formula, go to style->x+2 and enter:

if {@RawReqd}>{@RawAvailable}
then crBold
else crRegular

-LB
 
Then do the same thing for color->x+2 ?:

if {@RawReqd}>{@RawAvailable}
then crRed
else crBlack
 
That's correct, conditionally set whatever attributes you want.

Or you can use HTML formatting if you're familiar with it, though this is usually done when you want to conditionally format part of a string, as it's more difficult to control and may cause alignment problems.

thread767-422451

-k
 
Thanks everyone for the info. I looked all thru help for the style types in formulas,.... came up empty.
Thanks again...all is good now.
 
This also bring up another question...
Is there a way to combine the syntax all into the same line in the formula...like
Code:
if {@RawReqd}>{@RawAvailable}
then crRed,crBold
else crBlue,crRegular
I am not sure how to write this correctly.

Thanks
 
Then you would need to use dtempleton's solution, copied below and with a missing parenthesis restored. This assumes that the formula you want colored and bolded is the formula {@RawReqd}, so you will have to adapt this if this is not the field your want formatted. This converts the formula from a number to text. You then need to go to format field->paragraph->text interpretation->HTML text.

if {@RawReqd}>{@RawAvailable} then
"<font color=#FF0000><b>" & totext({@RawReqd}) & "</b></font>" else
"<font color=#000000>" & totext({@RawReqd}) & "</font>"

-LB
 
Thanks....I thought "crRed,crBold" was toooo simple a solution, guess I was right.

G
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top