Introducing SQL Server Reporting Services
by Wei-Meng Lee11/01/2004
Microsoft has finally added reporting capabilities to SQL Server 2000. With the rollout of SQL Server 2000 Reporting Services, you can now generate reports from your database without the need to use third-party reporting tools. In this article, I will walk you through the basics of creating a simple report using the SQL Server 2000 Reporting Services. In the next article, I will discuss how you can integrate reports into your .NET applications.
Installing SQL 2000 Reporting Services
The SQL 2000 Reporting Services comes in three editions: Developer, Standard, and Enterprise. If you are running Windows XP, then you should use the Developer edition. There are a few prerequisites that you need to satisfy before you can install SQL Server 2000 Reporting Services on your machine:
- You must update SQL Server 2000 to Service Pack 3.
- You need to have Visual Studio .NET in order to use the Report Designer to design your reports. Also, ASP.NET 1.1 must be enabled on your web server. Initially, I had some frustrations with this aspect when I was installing SQL Server 2000 Reporting Services on a development machine. It kept complaining that ASP.NET 1.1 is not installed or not registered with IIS, and refused to install the server-side components of the Report Manager, although ASP.NET 1.1 was indeed installed on the machine. One quick way to solve this problem is to run the
aspnet_regiis.exe -iutility within the Visual Studio .NET command prompt to register the ASP.NET runtime with the IIS. To check if ASP.NET is associated with IIS, create a new ASP.NET web project in Visual Studio .NET and try to debug the web application by pressingF5. If its works, you should have no problem with installing SQL Server 2000 Reporting Services. For my case, I had no luck in installing SQL Server 2000 Reporting Services on my development machines. Ultimately, I managed to install it on a fresh machine in the following installation sequence: Windows XP, IIS, Visual Studio .NET 2003, SQL Server 2000, SP3, and then SQL Server 2000 Reporting Services. - You can (and should) install SQL Server 2000 Reporting Services on a separate server. This is the recommended option to avoid slowing down the main database server.
- To use the SQL Server 2000 Reporting Services, you need to have a valid license for SQL Server 2000.
Creating a Report
Once you are done with the installation, you should see a new project type in Visual Studio .NET 2003: Business Intelligence Projects (see Figure 1). There are two templates available: Report Project Wizard and Report Project.

Figure 1. The new project type for SQL Server 2000 Reporting Services
For now, select the Report Project template and name it "PubsReport." Click OK.
In Solution Explorer, you should see that under the PubsReport project are two folders: Shared Data Sources and Reports (see Figure 2). We will create a report using the Pubs database; right-click on the Shared Data Sources folder and select Add New Data Source.

Figure 2. Adding a new data source
In the Data Link Properties dialog, enter the name of your SQL Server. For my case, my SQL Server is on my local machine and hence I type "(local)" and select the Pubs database (see Figure 3). Click OK.

Figure 3. Selecting the database server
The next step is to add a new report to the project. In Solution Explorer, right-click on Reports and select Add New Report (see Figure 4). There are a few ways to add a report--use the wizard, manually add the report, or simply import a report. For starters, I strongly encourage you to use the wizard via the Add New Report option.

Figure 4. Adding a new report
You will now see the wizard. Select the shared data source you configured in the earlier step (see Figure 5). Click Next to proceed.

Figure 5. Selecting the data source to use for the report
For my report, I want to list book titles and their publishers' information from the titles and publishers tables. You can either use the Query Builder (click on Edit... in Figure 6) or type in the SQL string manually. Click Next.

Figure 6. Entering the SQL query
Select the report type. For this report, I have selected the Tabular type (see Figure 7). Click Next.

Figure 7. Selecting the report type
In the next dialog, you will choose the various fields to use for the report (see Figure 8). The list of fields is listed in the left list box. To assign a field to the relevant section of the report, select the particular field and click Page>, Group>, or Details>. Figure 8 shows that I want to display the publisher information on every page (hence the fields in the Page section) with all of the books' information grouped by type (hence the "type" field in the Group section). Within each book type, the detailed book information is displayed (hence the fields in the Details section). Click Next to proceed.

Figure 8. Designing the table
Choose the table layout and check the "Include subtotals" option if you want to sum up sales information of books in each type. The "Enable drilldown" option allows information to be collapsed or expanded (see Figure 9). Click Next to proceed.

Figure 9. Choosing the table layout
There are a couple of styles you can choose for the report (see Figure 10). Click Next to proceed.

Figure 10. Choosing the table style
In the last step, give a name to your report and click Finish to complete the wizard (see Figure 11).

Figure 11. Finishing the wizard
Deploying the Report
Before you deploy your report for the first time, you need to configure the target server for hosting your report. In Solution Explorer, right-click on the Project name and select Properties. In the TargetServerURL field, specify the location of your Report Manager, which is by default http://localhost/ReportServer (see Figure 12).

Figure 12. Specifying the server to deploy your report
To deploy the report, press F5. In the web browser, you will see the list of reports published by the current project (see Figure 13). Here, there are three reports (the first two were created prior to this current report): Report1, Report2, and TitlesReport. To view the new report, click TitlesReport.

Figure 13. The deployed reports
You should now be able to view the report (see Figure 14). Click on the + sign to expand the list of books under a particular type.
Figure 14. Viewing the report
What's cool about the SQL Server 2000 Reporting Services is that you can also export the report to various file formats. My personal favorite is the PDF option (see Figure 15).

Figure 15. Exporting the report to other file formats
Summary
In this article, I have briefly shown you the steps to create a report using the SQL Server 2000 Reporting Services. Using the wizard, you can create a new report quickly and easily. While this is useful for beginners, you should really explore the other features of the Report Designer to customize the format of the report as you become familiar with how the Report Designer works.
Wei-Meng Lee (weimenglee.blogspot.com) is a technologist and founder of Developer Learning Solutions, a technology company specializing in hands-on training of the latest Microsoft technologies.
Return to ONDotnet.com
You must be logged in to the O'Reilly Network to post a talkback.
Showing messages 1 through 18 of 18.
-
Reprting services
2007-07-17 23:54:35 amitgaur1984 [Reply | View]
How can we formate a report in a sql reporting services?I have a report displaying in a tabular format but the report is not vissible completely ?canu help me?
-
Dynamically Generate reports
2006-09-25 03:57:28 Alexande [Reply | View]
http://www.smartreportbuilder.com/
Really there's no need in experiencing various problems that occur while making reports. Smart Report Builder is an ASP.NET control for creating templates and running reports with user-defined run-time parameters in PDF, HTML, and CSV format against a Microsoft SQL Server database. Try this!
-
Grouping Issue in SQL Reporting Services 2000
2006-07-26 04:46:57 vishalMehra [Reply | View]
Hi,
I am using SQL Reporting services 2000.I am using grouping options in table to group my data as per one of the column.Now as per the group I am giving border style as Solid at the end of the group.It works fine normally.But issue comes if one of the group ends at next page.So in this case i get two lines in next page.One for last line(end of group) of previous page and other for header of my table which i also have given.
Now i want to ask is there any way of making reporting services to not to show last line of
previous group in next page.Can i write any code(expression),which can be written in border style
regarding to not to draw line at the next page, if group gets over at last in previous page.
Quick reply will be highly appreciated.
-
In Sql Reports to display no of records in the report
2006-06-11 21:34:36 Mallesh_Rec [Reply | View]
In the Sql Reports how do i get the count of the records displayed in the report. I have to pass a parameter into the report and just disply the count. Can any suggest me on this issue.
-
Nice Article
2006-02-24 06:44:25 adilkazmi [Reply | View]
you have written very nice article that anyone can understand specially beginers
Thans a lot
-
Introducing SQL Server Reporting Services
2006-01-19 04:59:09 Ghalib [Reply | View]
A good introductory text--To the point .
-
SQL Server Reporting Services
2005-12-05 22:37:38 vbobb [Reply | View]
Hi all,
Can we skip the first and last record in a dataset in SQL reporting services? if possible pls tell me. -
SQL Server Reporting Services
2007-10-06 00:28:20 Shankarcse [Reply | View]
Hello Friends,
I need one clarification regarding the HTML content in sql reporting service, i have a set of HTML contents with text fomatting..I i bind that text on the Sql report..I need that text should show in that HTML formatting text..Is it possible in Sql reporting service..?
-
Really nice article
2005-11-18 03:11:16 Nice [Reply | View]
I read the article that how to work on SQL Server Reporting Services. That is really great article.
It is for creating simple report.No one article can explain the same.
-
RS + MS Access Reports
2005-08-24 08:05:03 BenjaminChi [Reply | View]
Hi, After the MS Access Reports are upsized to MS Reporting Services (RS). Can MS Access access the MS RS reports? or does it have to be accessed via external application? If so, how can end users access the reports and design ad-hoc reports without additional tools?
Thanks,
Benjamin
-
<b>WebServices as Datasources</b>
2005-05-02 12:48:36 rdlcomponents [Reply | View]
Is really interesting the powefull of SQL RS and it extensions. For example now you can have n-tier scenarios using WebServices as Datasources.
Thanks
Jerry
--
WebServices Data Processing Extension
http://www.rdlcomponents.com/DTE/default.aspx
-
XML-RDL in java
2005-02-13 04:34:31 dor [Reply | View]
I have seen the implementation on your site.
Is there any implementation similiar to java and not to .Net?
Regards,
D. Orbach
booksprice - one book one click best price
-
Create your report Programmatically
2004-11-22 07:16:23 JerryV [Reply | View]
http://www.rdlcomponents.com/
You can create your Reports Programmatically using the RDL Writer Component specially designed for SQL Reporting Services, no Visual Studio no Designers Required
Generate the XML-RDL (Report Definition Language) file on the fly, programmatically in any .NET application with 100% managed code, with out any knowlegment of the RDL/XML format.
Create-Deploy-Reuse -
Create your report Programmatically
2006-10-10 23:54:16 SridharN [Reply | View]
Is it possible to modify an already deployed rdl file? Specifically can a rdl file be updated to add new parameters or alter existing parameters of a report?
Can you elaborate on the resource or component you are talking about!!







I have a problem with a report where users want to see transacctions grouped by Account number and type(e.g: incomes and payments).
And so I use a table object where I put 2 groups:
1) Group by Account Number: Field!Account.Value
2) Group by Transaction Type: Field!Type.Value
I put in the detaill row group by: Field!Type.Value and Field!Account.Value.
When I execute the report only show the first row per transaction type, but the dataset has some rows per transaction type.
Please help me with this problem, thanks...