![]() |
Database »
SQL Reporting Services »
General
Beginner
SQL Server Reporting Services 2005 XML extensionsBy Alexander NowakIn SSRS2005 a new provider is available: XML Data provider. This enables you to create reports from ADO.NET datasets or XML documents from URL-addressable resources, e.g. Web services. This article shows a step-by-step example (basic report , no parameters) how to use this new SSRS 2005 feature. |
SQL, VB 8.0.NET 2.0, WinXP, Win2003SQL 2005, VS2005, DBA, Dev
|
||||||||
|
Advanced Search Add to IE Search |
|
|
|
||||||||||||||||
Microsoft SQL Server Reporting Services (SSRS) has support for a plethora of data sources. Out of the box, its data modules, called data extensions, allow you to build reports from SQL Server and Oracle database, as well as any other database that comes with an OLE DB or ODBC provider.
In SSRS2005 a new provider is available: XML Data provider. This enables you to create reports from ADO.NET datasets or XML documents from URL-addressable resources, e.g. Web services.
This entry shows a step-by-step example (basic report , no parameters) how to use this new SSRS 2005 feature.
Here the example code for the report and the webservice.
Download xmlreport.zip - 10.6 KB
Download Northwind.zip - 28.2 KB
I have included several screenshots but some of them are not really readable but together with the example code you will be able to go through the example.
Mind that you will need
XML Data Extension
The common way for a SSRS server-side report to get its data is through the specification of a relational database and the SQL statement to retrieve the data. The report (interpreted by the report engine) is the consumer and the database is the provider of the data.
It's the SQL database data extension that will retrieve the data set specified in the report definition from the configured database during design time and run-time when the report has been deployed.

With the XML data extension is now possible to specify an xml document as data source or a web-service method that returns an ADO.NET (typed) dataset.

Instead of specifying a database and using SQL statements, you must point to a web service and specify the web methods and the Xpath for the returning result.
Benefits
Define a webservice with a webmethod that returns a (typed) dataset.


Configure the web service to use the IIS as host and not the default Visual Studio ASP.NET hosting server when you use VS2005 to build a web service. The web tab appears when you use the ASP.NET web service project template (available in VS2005 Service Pack 1 or you can download it as separate add-on)



Specify a data source that point to the previous defined webservice. Choose XML as data extension. The connection string the URL to the webservice
Specify the report data set. Instead of SQL syntax you must talk the "web-service" language. You can deduce this information from the web service test page and result page.
Basically you specify


Execute the data set

Make your report layout.

Preview the report.

Report deployment
Deploy the report on your report server.

Run the report from the report server portal. So now the data source ( web-service) will be called from the SSRS server to deliver the data to the report.
I found working with this new extension fun and very useful for some reporting needs we have. We used to work with a custom database extension for ADO.NET datasets. Now you don't need maintaining and deploying this custom extension for SSRS2005.
| You must Sign In to use this message board. | ||||||||||||||||||||||
|
||||||||||||||||||||||
|
||||||||||||||||||||||
|
||||||||||||||||||||||
|
||||||||||||||||||||||
General
News
Question
Answer
Joke
Rant
Admin
|
PermaLink |
Privacy |
Terms of Use
Last Updated: 25 Sep 2007 Editor: |
Copyright 2007 by Alexander Nowak Everything else Copyright © CodeProject, 1999-2009 Web17 | Advertise on the Code Project |