Is there a way to pass in an array to rs.exe
I am trying to make a command line util to let me register updates to my TFS SSRS reports.
I am using rs.exe. It has the -v option where you can pass in a parameter. Is there a way to pass in an array (or some kind of collection).
I would开发者_如何学JAVA like to pass in an array of Data Source Names.
I ran into the same problem and came up with this solution:
Powershell
$RssScriptPath = "C:\myRssScript.rss"
$TargetSsrsServer = "http:\\localhost\reportserver"
$MyStringArray = "val1", "val2", "val3"
& rs.exe -i $RssScriptPath -s $TargetSsrsServer -v _myStringArray=$MyStringArray
Rss script (VB)
Dim _phrase As String() = _myStringArray.Split(",")
Dim _values As String() = _phrase(0).Split(" ")
For index As Integer = 0 To _values .GetUpperBound(0)
PublishReport(_values(index))
Next
I only tried with a strings, but you may be able to use the same strategy to pass other types.
精彩评论