Pro SQL Server 2012 Reporting Services

(sharon) #1
CHAPTER 5  IMPLEMENTING DASHBOARD STYLE REPORT OBJECTS

Double click on your Sparkline control and then right click Visit_Count in the Chart Data window.
Choose Series Properties and navigate to the Fill tab. Select Gradient as the Fill Style, White as the
Secondary Color and a Gradient Style of Top Bottom. Finally, let’s set an expression to change color
based on our MonthlyGoal parameter. Click the fx button to the right of the top color choice to create an
expression. Clear out the default text, enter the following expression, and click OK to close the
expression editor. The Series Properties window should appear as Figure 5-22.


=IIF(SUM(Fields!Visit_Count!Value,"Month") >= Parameters!MonthlyGoal.Value, "Green", "Red")


Figure 5-22. Sparkline: Series fill options


We’ll be covering expressions later, but this expression is essentially comparing the total count of
visits for the month group against the value selected in the monthly goal parameter. Figure 5-23 displays
the report in preview mode. Change your Monthly Goal to 2000 and click the View Report button to see
the dynamic nature of our color expression. Normally, KPI’s are not implemented in this manner, but
one could see how to use a value to dynamically change the colors to provide an at-a-glance visual
indicator as to the success or failure of meeting predefined goals. Normally, these values would be stored
in a database to allow the value to be configurable.

Free download pdf