MSSQL Server Reporting Services: Black Belt Components: Ad Hoc Conditional Formatting for OLAP Reports

About the Series …

This
article is a member of the series MSSQL Server 2000 Reporting Services.
The series is designed to introduce MSSQL Server 2000 Reporting Services ("Reporting
Services"), with the objective of presenting an overview of its features,
together with many tips and techniques for real-world use. For more
information on the series, as well as the hardware / software requirements
to prepare for the exercises
we will undertake, please see my initial Database Journal article, A New
Paradigm for Enterprise Reporting
.

Basic
assumptions underlying the series are that you have correctly installed
Reporting Services, including Service Pack 1, along with the applications
upon which it relies, and that you have access and the other rights /
privileges required to complete the steps we undertake in my articles. For details
on the specifics of the adjustments necessary to quickly allow full freedom to
complete the exercises in this and subsequent articles, as well as important
assumptions regarding rights and privileges in general, please see earlier
articles in the series, as well as the Reporting Services Books Online.

This
article also relies upon MSSQL Server Analysis Services ("MSAS") for
a sample cube that will be used as a data source by the report with which we
work in our practice exercise. For information surrounding the installation of
MSAS and the sample OLAP databases and cubes that accompany the typical
installation of MSAS, see the associated Books Online.

About the BlackBelt Articles …

As we
have stated in earlier BlackBelt articles, one of the greatest challenges
in writing tutorial / procedural articles is creating each article to be a
freestanding document that is complete unto itself. This is important, because
it means that readers can complete the lesson without reference to previous
articles or access to objects created elsewhere. When our objective is the
coverage of a specific technique surrounding one or more components of a
report, a given administrative function surrounding all reports, and other
scenarios where the focus of the session is not the creation of reports,
per se, can be challenging because a report or reports often has to be in place
before we can begin to cover the material with which the article concerns
itself.

The BlackBelt
articles represent an attempt to minimize the setup required in simply getting
to a point within an article where we can actually perform hands-on practice
with the component(s) under consideration. We will attempt to use existing
report samples or other "prefabricated" objects that either come
along as part of the installation of the applications involved, or that are
readily accessible to virtually any organization that has installed the
application. While we will often have to make modifications to the sample
involved (we will actually create a copy, to allow the original sample to
remain intact), to refine it to provide the backdrop we need to proceed with
the object or procedure upon which we wish to concentrate, we will still save a
great deal of time and distraction in getting to our objective. In some cases,
we will still have to start from scratch with preparation, but my intention
with the BlackBelt articles will be to avoid this, if at all
possible.

For
more information about the BlackBelt articles, see the section
entitled "About the BlackBelt Articles" in BlackBelt
Components: Manage Nulls in OLAP Reports
.

Overview

Over
the years that I have spent implementing enterprise Business Intelligence
applications, I have found many uses, ranging from "simple to sublime,"
for conditional formatting. At its most basic, conditional formatting
can be used to identify exceptional data in a report. Examples (in the world
of the sample FoodMart organization) might include Products that sell
over or below certain thresholds, or Employees who have been around for
a period exceeding a certain number of years.

Conditional
formatting is obviously more intelligent than standard, or "absolute,"
formatting, where the format that is added to a text object, a field of
numbers, or other report object remains fixed regardless of the values being
printed or displayed. With conditional formatting, Reporting Services
evaluates the object to which it is applied, and formats the object based upon
its value. The most common example that comes to mind is to print or display
negative numbers in red, or enclosed in parentheses / brackets (something with
which I have a more than passing familiarity as a recovering CPA). However,
Reporting Services can do far more sophisticated conditional formatting with
numbers, strings, and a host of other objects.

In
Reporting Services, like any of the other enterprise reporting packages on the
market, we create what is conceptually a condition, or conditions, to which
we assign rules of behavior, consisting most often of a presentation style, but
certainly not limited to that. When a value, or other report object, meets the
criteria of the condition(s) we define, Reporting Services applies the
formatting or other behavior to the object.

In
this article, we will introduce conditional formatting in a basic application, and
then add a twist: We will practice the hands-on creation of parameterized
conditional formatting that will allow users to make runtime decisions surrounding
the formatting in their reports. Subsequent BlackBelt articles
will focus on more advanced conditional formatting, often in combination with
parameters and other components, and especially within the context of providing
a "real world" solution that I can share from my own experiences with
my readers, who can then implement the concepts in custom-fit manner in their
own implementations. Whether my articles show you how to do something you
always wanted to do, and your searches of various keywords led you here, or if
you’re a casual reader who obtains an idea that had not even occurred before
exposure to the article, I am confident that you will find that Reporting
Services stands ready to meet your needs – probably with multiple options and
means of approach.

While
we will deal in this article with an OLAP report, ad hoc conditional
formatting
can be accomplished in similar ways in reports based upon
relational sources. (As I have noted in other articles, my tendency is to focus
on OLAP reporting, because, while references abound that teach reporting for relational
sources in Reporting Services, virtually no references to OLAP reporting exist,
at the time of this writing, in any of the new books that have recently
appeared. Articles on the subject are also universally sparse – as is often the
case for those topics surrounding a new application that are not specifically
spoon-fed from its online documentation.) In this session, we will:

  • Make
    structural changes to a copy of a sample report, based upon a sample cube, to
    meet the business requirements of a hypothetical group of information
    consumers;

  • Create a condition
    whose criteria will be applied to report objects at run time;

  • Create a parameter,
    with which we will associate conditional formatting, to provide information
    consumers the ad hoc capability to apply conditional formatting;

  • Discuss the
    results obtained with the development techniques that we exploit;

  • Preview the
    report to ascertain the effectiveness of our solution.
William Pearson
William Pearson
Bill has been working with computers since before becoming a "big eight" CPA, after which he carried his growing information systems knowledge into management accounting, internal auditing, and various capacities of controllership. Bill entered the world of databases and financial systems when he became a consultant for CODA-Financials, a U.K. - based software company that hired only CPA's as application consultants to implement and maintain its integrated financial database - one of the most conceptually powerful, even in his current assessment, to have emerged. At CODA Bill deployed financial databases and business intelligence systems for many global clients. Working with SQL Server, Oracle, Sybase and Informix, and focusing on MSSQL Server, Bill created Island Technologies Inc. in 1997, and has developed a large and diverse customer base over the years since. Bill's background as a CPA, Internal Auditor and Management Accountant enable him to provide value to clients as a liaison between Accounting / Finance and Information Services. Moreover, as a Certified Information Technology Professional (CITP) - a Certified Public Accountant recognized for his or her unique ability to provide business insight by leveraging knowledge of information relationships and supporting technologies - Bill offers his clients the CPA's perspective and ability to understand the complicated business implications and risks associated with technology. From this perspective, he helps them to effectively manage information while ensuring the data's reliability, security, accessibility and relevance. Bill has implemented enterprise business intelligence systems over the years for many Fortune 500 companies, focusing his practice (since the advent of MSSQL Server 2000) upon the integrated Microsoft business intelligence solution. He leverages his years of experience with other enterprise OLAP and reporting applications (Cognos, Business Objects, Crystal, and others) in regular conversions of these once-dominant applications to the Microsoft BI stack. Bill believes it is easier to teach technical skills to people with non-technical training than vice-versa, and he constantly seeks ways to graft new technology into the Accounting and Finance arenas. Bill was awarded Microsoft SQL Server MVP in 2009. Hobbies include advanced literature studies and occasional lectures, with recent concentration upon the works of William Faulkner, Henry James, Marcel Proust, James Joyce, Honoré de Balzac, and Charles Dickens. Other long-time interests have included the exploration of generative music sourced from database architecture.

Latest Articles