开发者

Making text bold in SSRS depending on field's value

I want to make some text bold and underlined, if the the value of field in my database is, say "HD"

I mean, I have two fileds in the database. Text1 and Header. I display th开发者_运维技巧e Text1 in my report and if Header's value is "HD", then Text1 should be in bold and fontsize should be 12. Otherwise, just show it normally.

How to do it?

Thanks Furqan


It's like this earlier answer of mine which shows how to do a similar thing for text color. Select the Text1 cell in the report, and then from the Properties window, find "FontWeight" and hit the drop-down, and choose "Expression".

The expression you want will be something along the lines of:

=iif(Fields!Header.Value = "HD", "Bold", "Normal")

...basically, you're setting the Property "FontWeight" of Text1 to be "Bold" when Header is "HD", otherwise you're setting it to "Normal".

You'd do a similar thing for the FontSize property:

=iif(Fields!Header.Value = "HD", "12pt", "9pt")

(Obviously, set "9pt" to whatever font size is set normally at the moment!)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜