locked
Problems using the RS.EXE tool and its switches RRS feed

  • Question

  • I ham having problems related to using rs.exe 

    using this command below to deploy a report to a SSRS server 

    rs.exe -i DeploySSRS.rss -s http://pp000c2940a92a/ReportServer -v sourcePATH="C:\Programs\Workspace\Trunk\Reports\UView\Student\Admissions\" -v targetFolder="/UView/Student/Admissions" -v reportName="STAD-1120 Admission by Entry Type and College (5 Year Trend)"

    I get 

    !rs.exe -i DeploySSRS.rss -s http://pp000c2940a92a/ReportServer -v sourcePATH="C:\Programs\Workspace\Trunk\Reports\UView\Student\Admissions\" -v targetFolder="/UView/Student/Admissions" -v reportName="STAD-1120 Admission by Entry Type and College (5 Year Trend)"
    Unrecognized argument Admission
    !

    here is what my DeploySSRS.rss file looks like too

    Dim definition As [Byte]() = Nothing
    Dim warnings As Warning() = Nothing
    Public Sub Main()
    Try
    Dim stream As FileStream = File.OpenRead(sourcePath + reportName + ".rdl")
    definition = New [Byte](stream.Length) {}
    stream.Read(definition, 0, CInt(stream.Length))
    warnings = rs.CreateReport(reportName, targetFolder, True, definition, Nothing)
    If Not (warnings Is Nothing) Then
    Dim warning As Warning
    For Each warning In warnings
    Console.WriteLine(warning.Message)
    Next warning
    Else
    Console.WriteLine("Report: {0} published successfully with no warnings", reportName)
    End If
    Catch e As IOException
    Console.WriteLine(e.Message)
    End Try
    End Sub

    • Edited by robm9999 Friday, December 8, 2017 8:09 PM
    Friday, December 8, 2017 8:03 PM

All replies

  • Hi Robm,

    Try replacing spaces & special character from report name just to verify and then redeploy. Also first check SSDT to manually deploy the report because it will give you more descriptive error message if there is something wrong with the .rdl file or corrupted xml.

    Please let me know if this helps. Hopefully i have answered you correctly.

    Thanks, Hasham Niaz

    Friday, December 8, 2017 8:32 PM
    Answerer
  • yes i renamed the report to STAD-1120.rdl  ...no luck I can however deploy it using powershell see below. 

    However for whatever reason they want it done using rs.exe

    rdl is fine as i can deploy them using

    param([string]$p1)
    $fullPathIncFileName = $MyInvocation.MyCommand.Definition
    $currentScriptName = $MyInvocation.MyCommand.Name
    $currentExecutingPath = $fullPathIncFileName.Replace($currentScriptName, "")

    $separator = [string[]]@("\Reports")
    $currentExecutingPathArray = $currentExecutingPath.Split($separator, [System.StringSplitOptions]::RemoveEmptyEntries)
    $serverpath=$currentExecutingPathArray[1]
    $serverpath=$serverpath.Replace("\","/")
    $serverpath=$serverpath.Substring(0,$serverpath.Length-1)



    if ($p1 -eq "")
    {
     Write-Output("you need to pass the parameter of the SSRS server like: `n $currentScriptName <SSRS Server Name> ")
     exit
    }
    Write-output("uploading to -> $p1")

    $reportServerUri = "http://$p1/reportserver/ReportService2010.asmx?wsdl"
    $rs = New-WebServiceProxy -Uri $reportServerUri -UseDefaultCredentia  -Namespace "SSRS"

    # Upload all .rdl files in the current directory to a specific folder, and 
    # set their datasource references to the same shared datasource (should 
    # already be deployed).
    $targetFolderPath = "$serverpath"
    $warnings = $null
     


    Get-ChildItem *.rsd | Foreach-Object {
        $dataSetName = [System.IO.Path]::GetFileNameWithoutExtension($_.Name)
        $bytes = [System.IO.File]::ReadAllBytes($_.FullName)
     
        Write-Output "Uploading dataset ""$dataSetName"" to ""$targetFolderPath""..."
        $report = $rs.CreateCatalogItem(
            "DataSet",         # Catalog item type
            $dataSetName,      # Report name
            $targetFolderPath,# Destination folder
            $true,            # Overwrite report if it exists?
            $bytes,           # .rdl file contents
            $null,            # Properties to set.
            [ref]$warnings)   # Warnings that occured while uploading.
     
        $warnings | ForEach-Object {
        if ($_.Message.length -ne  0)
         {
          Write-Output ("Warning: {0} {1} " -f $_.Message,$_.Message.length)
         }
        }
     
    }

    Write-Output ("-------------------------------------------------------------------------------------------");

    Get-ChildItem *.rdl | Foreach-Object {
        $reportName = [System.IO.Path]::GetFileNameWithoutExtension($_.Name)
        $bytes = [System.IO.File]::ReadAllBytes($_.FullName)
     
        Write-Output "Uploading report ""$reportName"" to ""$targetFolderPath""..."
        $report = $rs.CreateCatalogItem(
            "Report",         # Catalog item type
            $reportName,      # Report name
            $targetFolderPath,# Destination folder
            $true,            # Overwrite report if it exists?
            $bytes,           # .rdl file contents
            $null,            # Properties to set.
            [ref]$warnings)   # Warnings that occured while uploading.
     
        $warnings | ForEach-Object {
        if ($_.Message.length -ne  0)
         {
          Write-Output ("Warning: {0} {1} " -f $_.Message,$_.Message.length)
         }
        }
    }

     
    Friday, December 8, 2017 10:21 PM
  • Hi robm9999,

    From your rs.exe commang, it seems you did not specify the path of the vb script (the path of DeploySSRS.rss), which is required when using rs.exe to deploy the report. 

    You could try to use the command 

    rs.exe -i "Path_of_file_DeploySSRS\DeploySSRS.rss" -s "http://pp000c2940a92a/ReportServer"

    -v sourcePATH="C:\Programs\Workspace\Trunk\Reports\UView\Student\Admissions\"

    -v targetFolder="/UView/Student/Admissions"

    -v reportName="STAD-1120 Admission by Entry Type and College (5 Year Trend)"

    Reference: SQL Server Reporting Services (SSRS) RS.EXE Utility

    Best Regards,

    Henry


    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, December 11, 2017 6:20 AM
  • Hi robm9999,

    May I know how is your issue going currently? If your issue is solved please mark the appropriate answer as Mark as answer.  This will help other members to find a solution if they face the same issue. If you still have any questions, please feel free to ask.

    Best Regards,

    Henry 

    • Proposed as answer by Henry Jiang Thursday, January 11, 2018 9:47 AM
    Tuesday, December 12, 2017 7:51 AM