Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 the 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

like image 912
Furqan Sehgal Avatar asked Feb 26 '11 18:02

Furqan Sehgal


People also ask

How do you make text bold in C#?

Text = GetMOValue(moDisk, "systemname"); txtType. Text = GetMOValue(moDisk, "MediaType"); txtModel. Text = GetMOValue(moDisk, "Model"); txtFirmware. Text = GetMOValue(moDisk, "FirmwareRevision"); .....

How do I render HTML tags in SSRS report?

Render html tags in SSRSDouble click on the TextBox that holds the Multiline custom field value. In General section, and Below Markup types > Selects “HTML – Interpret HTML tags as styles”.

How do you change the font color in SSRS report?

In the SSRS report, We can change the background color and font color. Right-click on a column and goto text box property. In the Font option, we change the font, style color and so on.


1 Answers

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!)

like image 126
Matt Gibson Avatar answered Sep 25 '22 08:09

Matt Gibson