How to create .rss file for deployment using rs.exe utility ?

  • Hi All,

    I have spent a lot of time doing SSRS development and across projects I have done the deployment directly from BIDS/SSDT or through report manager and also in Sharepoint.

    I was aware that there is a much better of doing the same using RS utility tool. While trying hands on it I found that the file needed to be deployed is a .rss file. But I have no clue how this file is created?

    BINGing (:-)) around wasn't of much help either.

    Every article that I have seen directly assumes that you have a .rss file created from God knows where.:w00t:

    Can anyone point a step by step approach how to create it from scratch ? Thanks a lot in advance.

  • Not sure if this helps or not but basically an rss file consists of a few basic "chunks":

    1. Declarations

    2. Parameters Collection

    Full Rss File Example:

    'Report Config Parameters

    Dim format as string = "HTML4.0"

    Dim fileName as String = pFilename

    Dim reportPath as String = pReportPath

    'report parameters

    Dim AcctID as String = pAcctID

    Public Sub Main()

    ' Prepare Render arguments

    Dim historyID as string = Nothing

    Dim deviceInfo as string = Nothing

    Dim showHide as string = Nothing

    Dim results() as Byte

    Dim encoding as string = Nothing

    Dim mimeType as string = Nothing

    Dim extension as string = "htm"

    Dim warnings() AS Warning = Nothing

    Dim reportHistoryParameters() As ParameterValue = Nothing

    Dim streamIDs() as string = Nothing

    rs.Credentials = System.Net.CredentialCache.DefaultCredentials

    Dim parameters(0) As ParameterValue

    parameters(0) = New ParameterValue()

    parameters(0).Name = "AcctID"

    parameters(0).Value = AcctID

    Dim execHeader AS New ExecutionHeader()

    Dim rpt AS New ExecutionInfo

    rpt = rs.LoadReport(reportPath, Nothing)

    rs.SetExecutionParameters(parameters, "en-us")

    rs.ExecutionHeaderValue = execHeader

    rs.ExecutionHeaderValue.ExecutionID = rpt.ExecutionID

    results = rs.Render(format, deviceInfo, extension, mimeType, encoding, warnings, streamIDs)

    ' Open a file stream and write out the report

    Dim stream As FileStream = File.OpenWrite(fileName)

    stream.Write(results, 0, results.Length)

    stream.Close()

    End Sub

    And simple way to call it:

    D-ECLARE @cmdrun varchar(750)

    SET @cmdRun = '

    rs.e-x-e -e Exec2005 -s http://SERVERNAME/reportserver/ -i '

    + '"C:\RssFiles\YourRssFile.rss"'

    + ' -v vFilename=C:\Reports\MyReport.htm -v vReportPath=/ReportServerReportFolder/ -v pParam1="1" -t -l0'

    EXECUTE xp_cmdshell @cmdRun

    * Note * "declare" misspelled on purpose to get around our company's incredibly touchy proxy server

    ______________________________________________________________________________Never argue with an idiot; Theyll drag you down to their level and beat you with experience

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply