CHAPTER 8 DEPLOYING REPORTS
Using the rs.exe Utility
In order to access one of the SSRS Web services, Reporting Services gives us a command-line utility
called rs.exe. This utility uses script files written in VB .NET, the only language you can use with the rs
utility, to access the Web service and allows us to call any of the published methods in the web service.
In this example, you will create folders, deploy a report, and create a new data source through the rs.exe
utility.
You can see the two files used in this example under the RS folder in the code examples for Chapter
- You will find an RDL file containing our report definition that you will deploy and an RSS file
containing the VB .NET code used to deploy the report and create the data source needed for the report.
If you do not have your code in the folder C:\Pro_SSRS\CH8\RS, some configuration will be needed.
The RSS file has two global variables declared at the top of the file. These hold the information of
where the report will be deployed on the report server and where the RDL files exist on your computer.
You can see these two variables in Listing 8-1. You should make any necessary changes to these variables
based on your setup.
Listing 8-1. RSS File Configuration
Dim parentPath As String = "Pro_SSRS/Chapter 8"
Dim reportPath As String = "C:\Pro_SSRS\CH8\RS\"
Now that you have the RSS file configured, we will discuss the three Web service methods that are
used. The first is CreateDataSource. This method creates a new data source on the report server and
takes the following five arguments:
- DataSource: The name of the data source to be created
- Parent: The full path on the report server where the data source will be created
- Overwrite: A Boolean variable used to express whether to overwrite an existing
data source of the same name - Definition: An object of the type DataSourceDefinition that holds the connection
properties of the data source - Properties: An array of Property[ ] objects that hold property names and values for
the data source
The second Web service method used is CreateReport. This method creates a new report on the
server and takes the following five parameters:
- Report: The name of the report to be created
- Parent: The full path on the report server where the report will be deployed
- Overwrite: A Boolean variable to express whether to overwrite an existing report of
the same name - Definition: A Byte array holding the report definition
- Properties: An array of Property[ ] objects that hold property names and values for
the report
The last Web service method used is CreateFolder. This method creates a new folder on the server
and takes the following three parameters: