If you know a bit of SQL Server Reporting Services already, you may want to read something useful elsewhere :). This article is really intended for those that are uninitiated. This exercise would be over in a few minutes. SO if you have spare time, allow me to introduce to you SQL Server’s Reporting Services.
Most of my day job is involved in developing reports for our company’s products using SQL Server’s Reporting Services (SSRS). From the first day it was introduced as a crappy add-on to SQL Server 2000 up to this day as a powerful reporting platform/BI tool for SQL Server 2008 R2, it has served our requirements well beyond our expectations. However, everytime I get to talk with fellow developers in our community and in our sector, a lot of them still use Crystal Reports, probably because everybody just had it as part of Visual Studio for quite sometime now. I am not sure now how SSRS fares against Crystal Reports as it has been years since I got my hands on Crystal Reports. I have heard, the product is now with SAP.
Moving on, SSRS enhancements were quite substantial when Microsoft released it with SQL Server 2005 and lot of SSRS goodies appeared in version 2008. I now use both SQL Server 2008 and R2 versions but I would mainly write about what is in the 2008 version. Based from my experience with the tool, I intend to write a series of articles that would discuss various techniques, from basics ones to advanced, that I apply in most of the SSRS reports that I get to ship with our products or deploy to our customers. I probably would focus more on report development but will tackle any SSRS matter that I will find useful and worth sharing. But first things first, this specific article is just for developers who have not yet even tried SSRS but are willing to try it out in their spare time. I also would assume that anyone who would want to try this out have already some experience with SQL Server 2008 and have some knowledge on how to extract data from databases.
The easiest way for someone to get an idea how SSRS 2008 works is to make it really simple, old school simple. I am doing a Hello World example. It is so simple so anyone gets to appreciate how easy it is to use and develop reports using SSRS in SQL Server 2008. But this is just a start though.
So What Will We Do?
Assumming, you already have a running SSRS on some server, let us make a report that will accept a text value from a single textbox and have it displayed back in the report together with some other text.
What Do You Need?
Of course you would need SQL Server 2008. I’d assume you have SSRS installed already. I won’t be discussing for now how you will install SSRS just in case you missed it the first time you installed SQL Server 2008. Try to Google around on how to install SQL Server 2008 with Reporting Services.
Developing The Report
So here is how … open up SQL Server Business Intelligence Development Studio and do the following:
1. Create New Project
> Click on File
> Click on New Project
> Select on Business Intelligence Projects on Project Types panel
> On the name box, type in “HelloWorld”
> click Ok
2. Creating a Report
> In the Solution Explorer pane, right click on Reports folder, then select Add, then click New Item…
> Choose Report on the available report templates
> Click Add. Name it as Report1.rdl. A new report will then be created and it will look something like this:
> On the left pane, right click on Parameters folder, then Add Parameter. Type in, as shown in the following screen, then click OK.
> On the left pane, open the Toolbox. Or from the Main Menu, click on View, then click Toolbox.
> Drag a Textbox on the design surface. We will use this control to display the value that we are passing through a parameter.
> Right click on the Textbox, select Expression, and type in the expression value as shown below:
> Click OK once you are done.
> On the design pane, click on Preview tab. You will then see a textbox prompting you to type in your name.
> If your name is ‘World’, type in the textbox ‘World’, then click on View Report on the upper right corner of the Preview pane.
.. and voila! You just made your first SSRS report.
You may then upload Report1.rdl to any SSRS server and see what happens.
This exercise is pretty simple and just wanted to get your hands dirty with SQL Server Reporting Services if you still haven’t tried yet.
I hope this helps. I’ll try to show you some other SSRS goodies in my future postings.
Toto Gamboa is a consultant specializing on databases, Microsoft SQL Server and software development operating in the Philippines. He is currently a member and one of the leaders of Philippine SQL Server Users Group, a Professional Association for SQL Server (PASS) chapter and is one of Microsoft’s MVP for SQL Server in the Philippines. You may reach him by sending an email to firstname.lastname@example.org