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
 

Create Reports from Any Data Source Using SQL Server Reporting Services Custom Data Extensions : Page 4

SQL Server Reporting Services makes it easy to build reports from database data, but what if the data isn't in a database? This article shows you how to take advantage of Reporting Services' unique extensibility model to build reports from ADO.NET datasets.


advertisement
Debugging Custom Data Extension
Follow these steps to step through the CDE code.

 
Figure 3. Debugging: Use the "Start external program" debug option to step through your CDE project from the report that uses the CDE.
  1. Add both the CDE and SSRS projects to the same VS.NET solution.
  2. Open the CDE project properties and set up the Debug tab, as shown in Figure 3.
  3. Back to the Solution Explorer, set your CDE project as a startup project.
  4. Place breakpoints in the CDE code. Hit F5 to start debugging.
  5. Once the SSRS project is launched in a separate instance of VS.NET, open the test report, switch to the Data tab and run the query.
At this point, execution should hit your breakpoint and you should be able to step through the CDE code.

Deploying a Custom Data Extension
You must deploy and register the CDE properly with the Report Designer and Report Server before you can use it on the report. Configuring the CDE involves modifying several configuration files. For your convenience, I included my version of the affected configuration files, but please do not overwrite your configuration files with mine. Instead, use them for reference only.

Tip: To automate the CDE deployment, I've created a post-build script (see Build Events tab on the CDE project properties) that copies the CDE assembly to the Report Designer and Report Server folders. The caveat is that each time you build the solution, the Report Server Web application will be restarted because it will detect the file change. If this becomes an issue, use the VS.NET Configuration Manager to exclude the CustomDataExtension project from the build. If you make code changes to the CDE, explicitly build its project.

Registering the CDE with the Report Designer
At design time, the CDE is used by the Report Designer. Follow these steps to configure the CDE.

  1. Copy the CDE assembly (Prologika.CustomDataExtension.dll) to the Report Designer folder (C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies).
  2. In the same folder, open the RSReportDesigner.config file and locate the <Data> element.
  3. Add the following line after the last <Extension> element in the <Data> section.

<Extension Name="DATASET" Type= "Prologika.RS.Extensibility. CustomDataExtension.DsConnectionWrapper, Prologika.CustomDataExtension"/>

  1. If VS.NET is open, close it and open it again to restart the VS.NET IDE and reflect the configuration changes.
At this point, the Report Designer configuration is complete, and you should be able to create a data source using the CDE.

Registering the CDE with the Report Designer
At runtime, the Report Server interacts with the CDE. Here is how to configure the CDE with the Report Server.

  1. Deploy the CDE assembly (Prologika.CustomDataExtension.dll) to the Report Server binary folder (C:\Program Files\Microsoft SQL Server\MSSQL.3\Reporting Services\ReportServer\bin).
  2. Open the rsreportserver.config file from the C:\Program Files\Microsoft SQL Server\MSSQL.3\Reporting Services\ReportServer folder.
  3. Locate the <Data> element and register the CDE extension just like you did with the Report Designer configuration file.
  4. To grant the CDE code the necessary security permissions, open the rssrvpolicy.config and add the following code group:

<CodeGroup class="UnionCodeGroup" version="1" Name="CustomDataExtensionCodeGroup" Description= "Code group for the Custom Data Extension" PermissionSetName="FullTrust"> <IMembershipCondition class="UrlMembershipCondition" version="1" Url="C:\Program Files\ Microsoft SQL Server\MSSQL.3\ Reporting Services\ReportServer\bin\ Prologika.CustomDataExtension.dll"/> </CodeGroup>

You don't need to restart the Report Server after making this change (this will happen automatically). After these steps, you should be able to successfully author a report that uses the CDE.



Comment and Contribute

 

 

 

 

 


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

 

 

Sitemap