I have one column in my stored proc which contains following data:
abcs,defs,CA(5,6);wsdf,kdh,CA(7,8)
Now I want only data in brackets to be bold and else everything regular, like so:
abcs,defs,CA(5,6);wsdf,kdh,CA(7,8)
I have one column in my stored proc which contains following data:
abcs,defs,CA(5,6);wsdf,kdh,CA(7,8)
Now I want only data in brackets to be bold and else everything regular, like so:
abcs,defs,CA(5,6);wsdf,kdh,CA(7,8)
Create a custom code function to bold the text: right-click on a non-design part of the report surface, choose Report Properties...
and click the Code
tab. Enter the following code:
Function BoldText(Text As String) As String
return Text.Replace("(", "(<b>").Replace(")", "</b>)")
End Function
Go to your field cell and change the expression for the value from just the field value to calling this function with the field value:
=Code.BoldText(Fields!FieldToBold.Value)
Now, this bit is the key - in your cell, click on where it shows <<Expr>>
so it is highlighted then right-click it and choose Placeholder Properties...
. On the General
tab select the radio button to activate HTML - Interpret HTML tags as styles
.
Now anything between the brackets will be bolded.
Update - changing the font colour
You can also change the font's colour by using the <font>
HTML tag (the following example makes anything between the brackets red and bold):
Function BoldText(Text As String) As String
return Text.Replace("(", "(<font color=Red><b>").Replace(")", "</b></font>)")
End Function