It is a truth universally acknowledged in the Business Intelligence industry
that all data ends up in Excel spreadsheets sooner or later. No matter how
many thousands of dollars you've invested in state-of-the art AJAX-enabled
thin clients or ad-hoc query tools that can slice and dice your data down
to the millisecond, your users will always want to know where the 'export
to Excel' button is.
As a result, one of the most common requirements
for a BI solution is to be able to generate and distribute large numbers
of Excel-based reports on a regular basis and in this article I'll describe
one way of doing just that using SQL Server 2005 Integration Services
and SoftArtisans OfficeWriter.
Before I do that, though, I'm going to answer two questions that those
of you with some experience in the BI industry will probably have after
reading the title of this article: firstly, why use a third-party tool
to generate Excel spreadsheets when both Integration Services and Reporting
Services have native functionality that allow you to do this? And secondly,
why use Integration Services for this task when, if you're using the Microsoft
SQL Server BI suite, Reporting Services is the obvious choice of tool
for the job?
SoftArtisans OfficeWriter is a complete solution for the server-based
generation of Excel spreadsheets and Word documents that doesn't need
Office to be installed on the server.
It exists as a web application and a set of custom rendering extensions
for Reporting Services, but you can also use the underlying components
in your own code and that's what I'll be doing later on. Its big advantage
over Integration Services' Excel dataflow destination and Reporting Services'
Excel rendering is that it is template-based: you create your own Excel
spreadsheet with 'data markers' defined in it, and when you want to generate
a new spreadsheet OfficeWriter takes this template and replaces the markers
with real data.
Integration Services and Reporting Services' native functionality create
an Excel spreadsheet from scratch and, as a result, are severely limited
in terms of the features of Excel they support _ you're only able to create
the most basic of spreadsheets and if it is possible to get more than
that it's a major development task do so. With OfficeWriter, anyone familiar
with Excel can create a template and these templates can make use of any
Excel feature such as formulas, VBA macros, pivot tables and multiple
sheets. As a result, you can let your resident Excel gurus off the leash
to design the flashy dashboards they love, but at the same time be able
to generate these dashboards in a production-strength, server-based system.
This allows you to avoid the manual cutting and pasting that has been
the bugbear of Excel-based reporting in the past.
In addition, the Enterprise Edition of OfficeWriter has some cool functionality
that allows you to modify the design of the spreadsheet at the time of
generation: for example, a chart type could be changed if a user preferred
to see a line graph rather than a bar graph, or if you were using colored
cell backgrounds to highlight values over a certain threshold you could
set these thresholds differently for different users.
As you may know, SQL Server Reporting Services has a feature _ data driven
subscriptions _ which allows you to automatically run a batch of Reporting
Services reports using parameter values sourced from a query; it works
very well, but there are a few reasons why you might not want to use it.
First and foremost is price: data driven subscriptions are an Enterprise
Edition feature and if you're using SQL Server 2005 Standard Edition you
might not be able to justify the significant extra cost of upgrading to
get this functionality: the list price of a Standard Edition per processor
SQL Server licence is $5,999 compared to $24,999 for Enterprise Edition.
The solution I'm about to describe can be implemented in Integration Services
Standard Edition.
Furthermore if you need to do any transformation or integration on your
data before you can build your reports you're probably going to need to
do some work in Integration Services anyway so you might as well implement
the whole solution there. And of course if you've already got Integration
Services skills but have never used Reporting Services, why bother to
learn a new tool?
Using the OfficeWriter components inside Integration Services is straightforward,
and I put together the following package to show just how simple it is. |