views:

592

answers:

1

Hi All,

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

+1  A: 

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. http://stackoverflow.com/questions/987672/format-make-bold-or-italics-a-portion-of-a-textbox-or-formula-object-in-crystal

Dusty
No, I mean that I want to set it in the code of crystal report 10. For example: I have one formula field (@description). And in the code, I want to set like that @description=crBold or @description=crItalic
Sopolin
@Sopolin - See my edit.
Dusty
+1 it's much easier to use html interpretation than it would be to programmaticly change the report layout. at least IMHO.
dotjoe
I'm using crystal report viewer in vb.net to view report. So I don't know how to set it. You know, I can only format the font style when I design but if I format it in the design, all data are the same like bold, it bold all. But I want to check sum words then I set bold to this word only. Could you help me?
Sopolin
I'm not really sure how I can be more specific than my answer. You need to right click on the field you want to format, Choose Format Object, and change the Text interpretation to "HTML Text" Then you can pass in HTML to the field instead of only passing in data. Check out this link for a simple tutorial on HTML. http://www.w3schools.com/htmL/
Dusty