Modify the Foodmart Sales Report to Prepare for Our Procedural Steps
sample objects that come along with an installation of Reporting Services are
often the best to use in a practice example such as the one that follows,
primarily because virtually everyone who has installed Reporting Services has
access to these samples. The use of copies of pre-fabricated reports, among
other sample objects, in this and other of my articles has saved significant
amounts of time in preparing for practice sessions, allowing us to focus upon
the specific techniques which the article is contrived to address. One of the
disadvantages of working with readily available sample objects is that they are
just that samples - and, as most of have become aware, the samples provided
with even enterprise-level applications can be quite simplistic with regard to
their reflection of business reality.
We have before
us an example of this that we will need to manage with a minor adjustment: one
of the specifications of the information consumers includes the conditional
formatting of the existing Store Profit values. The consumers have
stated that they wish to have negative values formatted in a manner that
attracts attention. To perform the steps necessary to demonstrate an approach
to doing this requires one thing that is not found in the sample data a
negative Store Profit number! It would seem that FoodMart never meets
with anything but a profit, even at a granular level, with any product it
adjust the Store Cost value, within the Store Profit calculated
field, with a simple multiplier to generate a few negative numbers, to make the
conditional formatting portion of our practice session possible. To do this,
as well to prepare the report further for our exercises, we will take the
Within the RS020 project tree in the Solution
double-click the new SWITCH_CondFormat
report, to open
report opens within the Report Designer, and the Layout View
appears, as depicted in Illustration 12.
The Report Clone Layout View
the Store_Profit field in the Report Designer Field List. (If the
Field List does not appear, resurrect it by selecting View --> Fields from the main menu).
Edit... from the context menu that appears, as shown in Illustration 13.
Illustration 13: Select
Edit ... from the Context Menu
Field dialog opens.
Click the Expression
Editor (Fx) button that appears at the immediate right of the Calculated
field box, in the lower portion of the dialog, as depicted in Illustration
Illustration 14: Click
the Function Button ...
expression within the Expression box with the following:
=Fields!Store_Sales.Value - 2.5*(Fields!Store_Cost.Value)
box appears, with the new expression, as partially shown in Illustration
Illustration 15: The
Replacement Expression in the Expression Box (Partial View)
Click OK to
accept our modification, and to close the Expression Editor.
have now adjusted the Store Profit calculated field to generate some
negative numbers in the report. We will, of course, be forced to "suspend
disbelief" in the accuracy of the Store Profit values (no longer
simply Store Sales minus Store Cost), but this will be a simple
sacrifice to allow anyone with the standard samples to perform the exercises
that follow. (We can be confident that calculated fields can generate
accurate values in simple subtraction scenarios like this in the real world
our focus here is conditional formatting, and this is simply a way to
make the process possible).
Click OK to
close the Edit field dialog.
returned to the Layout view for the report. To conclude our preparation
steps, we will eliminate the existing Product Family parameter from the
report, in accordance with the expressed wishes of the information consumers.
--> Report Parameters (click a point within the Layout
view of the report to enable the Report menu item, if it does not
already appear) from the main menu atop the Report Designer, as
depicted in Illustration 16.
Illustration 16: Select
Report --> Report Parameters from the Main Menu
Parameters dialog, where we define parameters for the report, appears, as
shown in Illustration 17.
Illustration 17: The
Report Parameters Dialog
In the Parameters
list, on the left side of the dialog, click the single entry, ProductFamily,
to select it.
Click the Remove
button underneath the Parameters list.
parameter is removed from the list.
Click OK to
accept removal of the parameter.
now empty Report Parameters dialog closes, and we are returned to the Layout
view of the report. We must now delete a reference to the parameter we have
removed, which we can access via the Properties dialog for the matrix.
Click at some
point within the title textbox of the report (containing the label Foodmart
Sales), to make the row and column headers of the matrix data region
the upper left corner of the matrix. (If the headers disappear as you touch
them with the cursor, you should still see a faint outline of the matrix.)
from the context menu that appears, as depicted in Illustration 18.
Accessing the Matrix Properties
Properties dialog opens, defaulted to the General tab.
Click the Filters
Click the Value
field of the single occupied row to select it.
Click the Delete
button to delete the reference to the parameter, as indicated in Illustration
Illustration 19: Select
and Delete the Parameter Reference
remaining reference to the now-deleted parameter is itself deleted.
to accept our changes and to close the Matrix Properties dialog.
now ready to proceed with modifications to our report to meet the conditional
formatting and other presentation requirements of the information