One of the most underused functions I have found in Reporting Services is the use of conditional formatting.

Lets face it, in today's Ridilin influenced ADD society, we need to draw attention to significant events.  Lets face it, Outlook, pops up alerts for calendars, new messages, tasks, the phone rings, pagers, bosses.... you get the idea, people are distracted.  When developing a report that is going to contain important information, the use of conditional formatting can help "direct" traffic to the important things.

Think KPI...

In any flavor of SSRS today, conditional formatting can be easily accomplished, but there a couple of important things to keep in mind.

  • Everyone may not view the report in the colors you expect them to.  Black and white printers, color blind, etc can cause havoc when thinking about formatting.
  • Follow the KISS (Keep It Stupid Simple) principle.  Smiley face good, Frown Bad.

I'm sure there are more considerations, forward additional items to me...

Anyway, down to business.  How do we perform conditional formatting. 

Decided how you want to draw attention to your item.  Consider using font changes (size or structure changes), graphical indicators (arrows, faces, etc), Color or shading (remember what I said earlier) to gain the report views attention.

You can get really creative with the native functions within reporting services, such as row or page numbering, execution time, but for simplicity sake lets keep things simple.  In my example I'm going to change the font to bold for each value in the row if that row is from PA. 

I'm going to assume you already have a Matrix of data on your report.  Click on a field in the row that has the fields displayed.  From there you will see the row and column headings appear in the designer.

Select the entire row then in the properties pane, expand the Font section.

Click the drop down for Font Weight and select the top element <Expression>

Here is where the magic happens, replace the existing text with a customized function that performs the highlighting you want.   In my case, =iif(fields!ows_State.Value="PA", "Bold", "Normal")

When you preview the report, you should see items matching the expression we just created highlighted in bold.

Hopefully you will find this technique useful and you begin creating reports that allow your users to quickly find the important data.

Happy formatting!

Technorati Tags: ,