Skip to content

Latest commit

 

History

History
52 lines (41 loc) · 3.45 KB

format-a-reporting-services-script-file.md

File metadata and controls

52 lines (41 loc) · 3.45 KB
title description author ms.author ms.date ms.service ms.subservice ms.topic ms.custom helpviewer_keywords
Format a Reporting Services Script File
Learn how to format a Reporting Services script file in Microsoft Visual Basic .NET that contains user-defined procedures and module-level variables.
maggiesMSFT
maggies
03/14/2017
reporting-services
tools
conceptual
updatefrequency5
scripts [Reporting Services], formats
formats [Reporting Services], script files

Format a Reporting Services Script File

A [!INCLUDEssRSnoversion] script is a [!INCLUDEmsCoName] Visual Basic .NET 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 [!INCLUDEvbprvb] 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 that you create need only refer to the rs module-level variable to perform any of the Web service operations that are available in the Web service library. The following [!INCLUDEvbprvb] code calls the Web service xref:ReportService2010.ReportingService2010.ListChildren%2A 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   

Important

User credentials are managed by the script environment and passed through command prompt arguments through the use of RS.exe. Although you can use the rs variable to set the authentication of the Web service, it is recommended that you use the script environment. You do not need to authenticate the Web service in the script file itself. For more information about authenticating the script environment, see RS.exe Utility (SSRS).

You do not declare namespaces within the script file. The scripting environment makes several useful [!INCLUDEmsCoName] [!INCLUDEdnprdnshort] 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.

See Also

Report Server Web Service
Technical Reference (SSRS)
RS.exe Utility (SSRS)