Databases Reference
In-Depth Information
utility will only use http . If you specify https and it's not supported on the server, the RS utility will
return an error.
By default, the RS utility will authenticate against the target Report Server instance using the credentials
provided by the user running the script. Both the user name and password arguments are optional argu-
ments and can be used to provide different credentials. The script itself can provide credential values
through the rs object, but hardcoded credentials are a security threat. It's better to have the script
authenticate credentials passed by the user at runtime; the user name must include the domain name
and user account.
The timeout value is an optional argument and is used to specify the number of seconds before the con-
nection to the server times out. The default value is eight seconds. Providing a value of zero means the
connection never times out.
If you want your script to run as a batch, you can indicate that by using the optional /b argument.
Batches are particularly useful when you need to be sure that the same action is performed on multiple
machines; for example, when running a script against multiple machines in a server farm. A batch runs
as a type of minitransaction where failure of commands within the script causes the batch to roll back.
This argument doesn't take any values. The RS utility default behavior is to run scripts without creating
a batch.
Your VB script can also contain variables with user-provided values. These variables are not declared in
the script and are available globally to any member within the script. The values are supplied using /v
arguments for each variable, which are provided as name=value pairs. The following code shows an
example:
rs /i DeployReports.rss /s http://localhost/reportserver/reportservice.asmx /v
targetURL= http://localhost/reportserver/reportservice.asmx
The quotation marks around the value are optional unless the value contains spaces. The /v argument is
optional unless your script uses a variable value that's not declared in the script. If the script takes an
argument that the user doesn't supply, the script will not compile.
The /t argument is also optional; it turns on tracing to view request processing and capture information
about returned errors.
When your script runs, the RS utility creates an instance of the scripting engine to run it. The VB script-
ing engine uses the same code base as VB, so you have access to standard VB functionality from within
your script. You'll take a closer look at the hosting environment capabilities and limitations throughout
the rest of this chapter.
Creating a Script Using Code
Although Visual Studio is not required for script execution or development, it's ideal for development
because the developer has the support of syntax highlighting, code completion, and IntelliSense . The
development environment provides sophisticated debugging capabilities, and the file can be managed
as part of a Visual Studio 2005 project.
Visual Studio is a robust development tool that's familiar to most .NET developers. Its IntelliSense, code
completion, and debugging capabilities help ease the development of rss scripts as well. If you plan on
Search WWH ::




Custom Search