Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


advertisement
 

Build an XML Data Extension for SQL Server Reporting Services : Page 5

Get to know the main features of SQL Server Reporting Services and learn how to extend it with an XML Data Provider Extension.


advertisement
Installing the Extension
The first step to deploying the extension DLL is copying it to the report server bin directory (the default location is C:\Program Files\Microsoft SQL Server\MSSQL\Reporting Services\ReportServer\bin) and to the report designer bin directory (the default location is C:\Program Files\Microsoft SQL Server\80\Tools\ReportDesigner\bin). In the downloadable code that accompanies this article, the C# project that implements the data extension does this automatically using a bat file run as a post-build step.

As a second step, you must add the following entry to both the RSReportServer.config and RSReportDesigner.config files under the Data element:

<Extension Name="XMLExtension" Type="class name,assemblyname"/>

To enable the generic query designer for the sample data-processing extension, add the following entry to the RSReportDesigner.config file under the Designer element:


<Extension Name="XMLExtension" Type="Microsoft.ReportDesigner.Design. GenericQueryDesigner, Microsoft.ReportingServices.Designer"/>

The following final steps register the new data extension to the Code Access Security infrastructure:
  1. Open the report server policy configuration file (rssrvpolicy.config). The default location for it is C:\Program Files\Microsoft SQL Server\MSSQL\Reporting Services\ReportServer.
  2. Data-processing extensions must be granted full trust. Therefore, add the following code group information to the configuration file as a child of the root code group (IMembershipCondition= AllMembershipCondition, PermissionSetName="Nothing"):

    <CodeGroup class="UnionCodeGroup" version="1" PermissionSetName="FullTrust" Name="XMLCodeGroup" Description="Code group for my XML data processing extension"> <IMembershipCondition class="UrlMembershipCondition" version="1" Url="assembly path in the report server directory" /> </CodeGroup>

  3. If you are using the sample data-processing extension in Report Designer, repeat the previous step using the Report Designer preview policy configuration file (rspreviewpolicy.config). Add the following code group:

    <CodeGroup class="UnionCodeGroup" version="1" PermissionSetName="FullTrust" Name="XMLCodeGroup" Description="Code group for my XML data processing extension"> <IMembershipCondition class="UrlMembershipCondition" version="1" Url="assembly path in the report designer directory" /> </CodeGroup>

The default location for the rspreviewpolicy.config file is C:\Program Files\Microsoft SQL Server\80\Tools\Report Designer.

If you have set everything up properly, just fire up VS.NET and create a new Report Definition project using your language of choice. The newly registered XML Data Provider should appear as one of the available data source choices. To debug the extension, run another instance of VS.NET, open the XML Data Extension project, and attach the debugger to the other instance of VS.NET containing the report definition. Place some breakpoints and then ask for either a data preview using an exclamation point (!) in the Report Designer Data Tab or a report preview using the Preview Tab. Note that to recompile the Data Extension assembly you must exit the VS.NET instance that loaded the Report Designer (closing the solution is not enough).

RS: Already Good, and Will Improve
RS is an impressive product, considering it is just in version 1.0 (Microsoft will release a Service Pack quite soon, while version 2.0 is slated to ship with Yukon). In most situations, it fits the bill as-is, while direct access to its Web Services API, custom extension development, and third-party tools (such as runtime designer) should solve advanced application requirements.

Feel free to extend the connection string, parameter, and query syntax to fit your specific application needs.



Enrico Sabbadin is a software architect and developer who specializes in the Microsoft platforms. He trains and consults for Francesco Balena's Code Architects in .NET, application design, and security. He also maintains his own site for MTS, COM+, VBCOM, and .NET Enterprise Services FAQs.
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date