Sopolin
Sopolin

Reputation: 576

Set font style to formula field

I have a problem with crystal report 10. I have one formula field in the detail of crystal report. And I want to set font style in this formula field but I don't how to set it after I check the condition.

So please help to solve this problem!

Thanks, Ung Sopolin

Upvotes: 1

Views: 25310

Answers (3)

Salim Latif Waigaonkar
Salim Latif Waigaonkar

Reputation: 462

right click on FIELD OBJECT, click on FORMAT OBJECT, select FONT Tab, click on x-2 image

write following snippet

if({?Your_Parameter}='your value') then
 "Arial"
else
 "Times New Roman"

Upvotes: 1

David Carrigan
David Carrigan

Reputation: 21

Use something like this:

If {this} = "that" Then
     crItalic
Else
     crRegular

This would be in your forumla for font style of the field object.

My guess is bold would also be crBold. Just make your conditions and return either of the three to meet your needs.

Upvotes: 2

Dusty
Dusty

Reputation: 4697

You should be able to right-click on the field in the report and choose Format Field which will open the Format Editor. From there you should be able to navigate through the tabs to modify the field to whichever format you want. To change the font you would navigate to the Font tab. There should also be a Formatting toolbar at the top which has common formatting commands. If it is not there then go to View/Toolbars and check the Formatting tab. Hope this helps. Thanks

EDIT: If you want to change the format programmatically you can do it by changing the Text Interpretation of HTML and then passing in HTML code instead. See the accepted answer for the following question. Format (make bold or italics) a portion of a Textbox or Formula object in Crystal Reports

Upvotes: 1

Related Questions