Editor's Note: The Following MVP Monday post is by Data Platform Development: Training MVP William Vaughn
2012 marks the 40th year that I’ve been working with data. Along the way I’ve (had to) write COBOL, 360 Assembly Language, BASIC, C, Visual Basic and Visual Basic.NET programs to produce reports. Each time I had to learn a new language it meant I had to learn a new set of report development tools. I can say with some certainty that the technology created to generate reports from RDL report definitions is the easiest I’ve had to learn and use.
Most developers who have to create reports should have discovered the ability of Microsoft Reporting Services to host and manage a catalog of RDL reports. These reports can be built in a variety of ways—the most popular being the Business Intelligence Development Studio (BIDS) tools or Report Builder. But what many developers have not discovered is that this same (well, almost the same) RDL can be leveraged to render reports using the ReportViewer control.
Let’s make a quick review of how RDL is processed so you’ll understand where the ReportViewer control can help build report-rich applications. First, you’ll need an RDL report. As I said, you can use BIDS to create a report which is persisted during development as an RDL extension file. Once it’s deployed to the Reporting Services report catalog, it’s encrypted and protected using a sophisticated rights-management scheme. Included in the RDL are all of the details needed to
Once the RDL is defined, the hosted Reporting Services engine uses the RDL to render the report by:
What Reporting Services Can’t Deliver
Over the years report developers been asking Microsoft to make a number of changes to the report processors used to render the reports to further simplify their jobs. While some progress has been made, even the Denali versions of RDL still don’t provide:
The ReportViewer Control to the Rescue
Thankfully, the ReportViewer control has the ability to handle all of these thorny (and common) issues quite nicely, but before I get started let’s visit one sticky reality: Each version of Reporting Services (including Denali) supports a unique report processor capable of interpreting a single version of RDL. So far, there are 2003, 2005, 2008 and 2010 report processors in existence. Each is capable of rendering its corresponding version of RDL. Unless Denali (SQL Server 2012) creates another version of RDL (which it might) that means you’ll need a ReportViewer that matches one of these versions.
That’s the rub. Until Denali, the ReportViewer was one generation behind BIDS. That is, the ReportViewer that shipped with Visual Studio 2008 would only (locally) process 2005 RDL. Visual Studio 2010 would only work with 2008 RDL. The Denali version of the ReportViewer control is purported to work with the current (2010?) version of RDL. In any case, the ReportViewer control can also use its built-in Server class to render any version of RDL but you revert back to the limitations described above.
So, why is the ReportViewer control better? First, consider how the ReportViewer’s report processor is different. Check out Figure 1. Note that unlike the Reporting Services hosted report processor, the ReportViewer in “local” mode does not handle any of the data retrieval tasks at all. These are all up to your code. Local mode means the RDLc file is accessed directly by the application either from a local file or one available via URL. This also means the RDLc file is a bit different. It has its DataSources reconfigured to ensure the names match up with the report layout behind the scenes.
Figure 1: The ReportViewer's report processor
With the ReportViewer, you have the flexibility to:
Figure 2: Custom Parameter management UI
While I don’t have a lot of room left to get into expressions (that’s in another blog entry), consider that expressions can play a major role in the usability and performance of your reports—both developer performance (how fast you can create and maintain reports) and report performance (how quickly the report can return useful information).
If you have Visual Studio already installed on your development system, you can create BIDS report projects that fully support inclusion of Visual Basic class modules that can be incorporated in the report Code property or for externally referenced DLLs. Add to that the ability to create application test harnesses to make sure these functions and constants are working. Of course when working with ReportViewer control projects you also have the same capability in the report/application solutions. No, the expressions must all be in Visual Basic—no C# here unless it’s an externally referenced DLL.
I discuss the ReportViewer control in depth and illustrate a number of innovative features and a way to generate application client-picker user interfaces just using RDLc reports in my webinars held monthly by Progressive Tech Conferences. See http://betav.com/blog/billva and search for “Progressive” for more information. There’s also a long chapter on the ReportViewer in my “Hitchhiker’s Guide to Visual Studio and SQL Server (7th Edition)”.
William Vaughn is a 40-year veteran of the computer industry including 14 years at Microsoft. He’s the author of a dozen works of what he calls “technical fiction” including “Hitchhiker’s Guide to Visual Studio and SQL Server (7th Edition)” published by Addison Wesley. His company has also published his new novel “The Owl Wrangler” available on Kindle and print-on-demand from Amazon. Over the last few years he’s focused on Reporting Services and gives monthly webinars on the subject for Progressive Business Technology. See http://betav.com/blog/billva and http://theowlwrangler.com.
The MVP Monday Series is created by Melissa Travers. In this series we work to provide readers with a guest post from an MVP every Monday. Melissa is a Community Program Manager for Dynamics, Excel, Office 365, Platforms and SharePoint in the United States. She has been working with MVPs since her early days as Microsoft Exchange Support Engineer when MVPs would answer all the questions in the old newsgroups before she could get to them.
How do I obtain the bleeping thing?
How do I install it so that it shows up in my TOOLBOX ?