Events
Mar 31, 11 PM - Apr 2, 11 PM
The biggest SQL, Fabric and Power BI learning event. March 31 – April 2. Use code FABINSIDER to save $400.
Register todayThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
A Reporting Services script is a Visual Basic code file, written against a proxy that is built on Web Service Description Language (WSDL), which defines the Reporting Services SOAP API. A script file is stored as a Unicode or UTF-8 text file with the extension .rss.
The script file acts as a Visual Basic module and can contain user-defined procedures and module-level variables. For the script file to run successfully, it must contain a Main
procedure. The Main
procedure is the first procedure that is accessed when your script file runs. Main
is where you can add your Web service operations and run your user defined subprocedures. The following code creates a Main
procedure:
Public Sub Main()
' Your code goes here.
End Sub
The script environment automatically connects to the report server, creates the Web proxy class, and generates a reference variable (rs
) to the Web service proxy object. Individual statements you create only need to refer to the rs
module-level variable, to perform any of the Web service operations available in the Web service library. The following Visual Basic code calls the Web service ListChildren method from within a script file:
Public Sub Main()
Dim items() As CatalogItem
items = rs.ListChildren("/", True)
Dim item As CatalogItem
For Each item In items
Console.WriteLine(item.Name)
Next item
End Sub
User credentials are managed by the script environment and passed through command prompt arguments using RS.exe. Although you can use the rs
variable to set the authentication of the Web service, you should use the script environment instead. You don't need to authenticate the Web service in the script file. For more information about authenticating the script environment, see RS.exe utility (SSRS).
You don't declare namespaces within the script file. The scripting environment makes several useful Microsoft .NET Framework namespaces available to you: System.Web.Services
, System.Web.Services.Protocols
, System.Xml
, and System.IO
.
For script samples, see SQL Server Reporting Services Product Samples.
Events
Mar 31, 11 PM - Apr 2, 11 PM
The biggest SQL, Fabric and Power BI learning event. March 31 – April 2. Use code FABINSIDER to save $400.
Register todayTraining
Module
Scripting in Power Automate for desktop - Training
Explore Power Automate for desktop, enabling automation of complex scenarios using VBScript, JavaScript, PowerShell, and Python.
Documentation
Script with the rs.exe utility and the web service - SQL Server Reporting Services (SSRS)
Learn about the RS.exe utility that can be used to programmatically administer a report server by using scripts written with Microsoft Visual Basic.
Run a Reporting Services script file - SQL Server Reporting Services (SSRS)
View examples of how to run a Reporting Services script file from the command prompt by using the Reporting Services script environment (RS.exe).
RS.exe utility - SQL Server Reporting Services (SSRS)
Learn about the commands and syntax for the rs.exe utility that processes scripts used to automate report server deployment and administration tasks.