This library wraps the RS.exe tool and the OSQL.exe tool in custom MSBuild tasks, so you can automate Reporting Services Report and Scripting deployment, and SQL Server object scripting into an MSBuild project. The Osql custom task is based on the sample by Joey Benninghove, found on his blog.
You can create custom tasks for MSBuild by extending/deriving from the
Task base class or by implementing the
ITask interface. Feel free to use the source code, and please send me any comments or improvements.
To consume one of these tasks, just create an XML-based MSBuild project file like the following, and run it using the MSBuild.exe command:
<SqlToolsFolder>C:\program files\microsoft sql server\90\Tools\Binn
<TargetItems Include="**\*.rss" />
<Rs RsPath="$(RsTool)" InputFile="@(TargetItems)"
ServerURL="$(TargetReportServer)" WaitForExit="true" />
The example above executes all Reporting Services script files (.rss) found in the subdirectories of this project recursively. These .rss files could contain VB.NET code to deploy report RDLs, datasources, create folders, roles, assign security, etc.
All the arguments/parameters that the RS.exe and the OSQL.exe tool can take from the command line have been exposed in the custom task as public properties, such as the
RsPath and the
InputFile properties used in the above example.
Thiago started programming on Turbo Pascal at age 17, and quickly moved on to java and VB6, and finally landing on .NET. He has implemented custom .NET applications and BI Reporting solutions for many clients.
Thiago has co-authored a couple of SQL Server Reporting Services books, and also dabbles in SharePoint and many things Microsoft.
He is currently an architect/consultant for a specialized consulting firm in the Dallas area.