Click here to Skip to main content
15,885,366 members
Articles / All Topics
Technical Blog

SSRS Production Deployment: Part 2

Rate me:
Please Sign up or sign in to vote.
5.00/5 (2 votes)
4 May 2013Apache1 min read 9.8K  
Part 2 of SSRS production deployment

Introduction

In Part 1, we discussed that in development environment, we deploy reports by simply clicking “Deploy” in BIDS, but this won’t work in production. To deploy reports in production, we need to write an SSRS script, which is actually a piece of VB.NET code executing against SSRS web service.

A typical report consists of the report definition (the .rdl file) that references one or more data sources. And this is where things get tricky.

Deploying Data Sources

  1. Code to deploy a data source 
  2. Code to deploy data source and report

You create a data source using a call to rs.CreateDataSource() method. Unfortunately, this method does not accept .rds files that BIDS uses to store data source information. Instead, it wants a DataSourceDefinition object. This means that one must parse the .rds file and convert it to a DataSourceDefinition instance. Here’s a piece of code that does that. It is geared for datasources with integrated credentials, if you use other kind of credentials, you’ll need to make relevant modifications.

VB.NET
Dim doc As System.Xml.XmlDocument = New System.Xml.XmlDocument
doc.Load(rdsPath)

Dim dataSource As DataSourceDefinition = New DataSourceDefinition
dataSource.ConnectString = doc.SelectSingleNode_
("/RptDataSource/ConnectionProperties/ConnectString/text()").Value
dataSource.Extension = doc.SelectSingleNode("/RptDataSource/ConnectionProperties/Extension/text()").Value
dataSource.CredentialRetrieval = CredentialRetrievalEnum.Integrated
dataSource.Enabled = True
dataSource.EnabledSpecified = True

Dim name As String
name = doc.SelectSingleNode("/RptDataSource/Name/text()").Value

Dim overwrite As Boolean = false

rs.CreateDataSource(name, "/Data Sources", overwrite, dataSource, Nothing)

This was easy, wasn’t it? The full version of the code with logging and error handling can be found here.

But data sources are only one half of the story. In Part 3, we will discuss how to deploy reports.

This article was originally posted at http://www.ikriv.com/blog?p=1248

License

This article, along with any associated source code and files, is licensed under The Apache License, Version 2.0


Written By
Technical Lead Thomson Reuters
United States United States
Ivan is a hands-on software architect/technical lead working for Thomson Reuters in the New York City area. At present I am mostly building complex multi-threaded WPF application for the financial sector, but I am also interested in cloud computing, web development, mobile development, etc.

Please visit my web site: www.ikriv.com.

Comments and Discussions

 
-- There are no messages in this forum --