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

Font change formula 1

Status
Not open for further replies.

deebaglee

Technical User
May 16, 2003
301
GB
hi i am trying to format the detail section to make the fonts bold if the item type stage is equal to 15
however i keep getting the the following message "the formula result must be a number
my formula is {item_type_stage} = 15
 
Hi if i try it that way i get the message that a string is reqiured
please assist
 
Try this in your formula:

"if {item_type_stage} = '15' then crBold else crRegular"


~Brian
 
Sorry, I hadn't read the first post closely nor analyze your formula, try:

Right click the field->Format Field->Font->X 2 next to Style->

if {item_type_stage} = 15 then
crBold

If you get an error statinmg something about a number, put quotes around the 15

-k
 
PERFECT!!!!!!!!!!!!
one question though
why do we need to type in the if statement
i would have thought that it would bold the text if it
i use the formula {item_type_stage} = 15

 
There are numerous options, so it wouldn't know which to use.

Font-formatting constants
Constant Description
crRegular
Format font in regular type face.

crBold
Format font in bold type face.

crItalic
Format font in italic type face.

crBoldItalic
Format font in bold italic type face.

-k
 
The reason you need to put the if statement in is because the formula is not boolean like suppress is. As synapsevampire laid out, there is more than 2 possible constants that you can use for the font face. With a formula for Suppress, the result is either On or Off.

~Brian
 
strange!

i feel i am telling crystal (by selecting bold and then putting in the formula) that i want you to bold the font based of the statement i place in the X-2 box

 
Once you enter something in the (x-2) it overrides the other selection.

Try it with the suppress. Check the box, but then also add a conditional suppression. The conditional suppression takes over.

Mike
 
hi i am trying to carry out the formula on a string field

if {Stock_Trans_Log.Code} = "WE" then crbold

but i keep getting the message that "the result of the formula must be a string"
 
You're not entering this code in the correct place.

Read the 2nd line of SynapseVampire's 2nd post again.

Good luck this time,

Naith
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top