I am trying to format (bold or italics) only a portion of a textbox or Formula object (IFieldObject) in Crystal Reports for Visual Studio 2008.
I know how to make th
I don't know, if it is doable.
You could create a separate formula field for the value that you want to make bold & insert the formula field between other formula field, which will make it look like single sentence.
Create a formula for the date part, then embed it into a text box, then you can format any way you like
You can do this by inserting HTML markup in the field (using a formula) and then displaying the new formula as a HTML field.
e.g. Here's a basic Syntax formula that takes a field and adds the bold tag around the text before the colon.
dim sTmp as string
dim sLeft as string
dim sRight as string
dim sAll as string
sTmp = {yourtable.yourfield}
sLeft = (split(sTmp,":"))(1)
sRight = (split(sTmp,":"))(2)
sAll = "<b>"+sLeft+":</b>"+sRight
formula = sAll
If you place this new formula into the report and then ...
There are Gotchas here. The original text is not HTML encoded, and I'm sure my example code does a simple one-line thing in about ten lines. Also, if your field has no colons in it, you'll force an error. However, it should give you the right idea.