Click here to Skip to main content
Click here to Skip to main content
Technical Blog

Tagged as

SSRS Production Deployment: Part 2

, 4 May 2013 Apache
Rate this:
Please Sign up or sign in to vote.
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.

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.

License

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

Share

About the Author

Ivan Krivyakov
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 --
| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.150414.1 | Last Updated 4 May 2013
Article Copyright 2013 by Ivan Krivyakov
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid