What is use of RSS file in SSRS?
Hi,
Please anyone can tell me what is use of RSS (Reporting Services script) file in SSRS? What does this RSS file contain? Please provide me sample file if you have.
Thanks Shiven:)
March 24th, 2011 11:55am
Hi,
Rss file is used for deploying reports
Sample code from .rss file
Dim definition As [Byte]() = Nothing
Dim warnings As Warning() = Nothing
Dim DestinationFolder As String = "MyReports"
Dim parentPath As String = "/" + DestinationFolder
Dim ReportSource As String
Public Sub Main()
TRY
ReportSource = "D:\Users\Rajesh\MyReport"
rs.Credentials = System.Net.CredentialCache.DefaultCredentials
If rs.GetItemType("/MyReports") = Microsoft.SqlServer.ReportingServices2005.ItemTypeEnum.Folder Then
rs.DeleteItem("/MyReports")
End If
rs.CreateFolder("MyReports", "/", Nothing)
Console.WriteLine("Parent folder [MyReports] created successfully.")
CreateReportDataSource("MyDataSource", "SQL", "Data Source=(local);Initial Catalog=Northwind")
PublishReport("MyReport")
Console.WriteLine("Tasks completed successfully.")
CATCH ex As Exception
THROW ex
END TRY
End Sub
Public Sub CreateReportDataSource(name As String, extension As String, connectionString As String)
'Data source definition.
Dim definition As New DataSourceDefinition()
definition.CredentialRetrieval = CredentialRetrievalEnum.Integrated
definition.ConnectString = connectionString
definition.Enabled = True
definition.Extension = extension
TRY
rs.CreateDataSource(name, "/MyReports", False, definition, Nothing)
Console.WriteLine("Data source: {0} created successfully.", name)
CATCH e As Exception
Console.WriteLine("ERROR creating data source: " + name)
THROW e
END TRY
End Sub
Public Sub PublishReport(ByVal reportName As String)
TRY
Dim stream As FileStream = File.OpenRead(ReportSource + "\" + reportName + ".rdl")
definition = New [Byte](stream.Length) {}
stream.Read(definition, 0, CInt(stream.Length))
stream.Close()
rs.CreateReport(reportName, parentPath, False, definition, Nothing)
Console.WriteLine("Report: {0} published successfully.", reportName)
CATCH e As Exception
Console.WriteLine("ERROR while Publishing report: " + reportName)
THROW e
END TRY
End Sub
Rajesh Jonnalagadda http://www.ggktech.com
Free Windows Admin Tool Kit Click here and download it now
March 24th, 2011 4:43pm
Hi S Kumar Dubey,
Besides Rajesh Jonnalagadda’s professional suggestion, I would like to supply more information about RSS. A Reporting Services script is a
Visual Basic .NET code file, which defines the Reporting Services SOAP API. A script file is stored as a Unicode or UTF-8 text file with the extension .rss. The script file acts as a Visual Basic module and can contain user defined procedures and module-level
variables. For the script file to run successfully, it must contain the Main procedure.
For example, we can write scripts that set system properties on the report server. The following Visual Basic .NET script shows one way to set properties.
Public
Sub Main()
Dim props(0) As [Property]
Dim setProp As
New [Property]
setProp.Name = "EnableClientPrinting"
setProp.Value = "False"
props(0) = setProp
Try
rs.SetSystemProperties(props)
Catch ex As System.Web.Services.Protocols.SoapException
Console.Write(ex.Detail.InnerXml)
Catch e As Exception
Console.Write(e.Message)
End Try
End
Sub
For more information about script samples, please see
Script Samples (Reporting Services):
http://msdn.microsoft.com/en-us/library/ms160854(SQL.90).aspx
If you have any question, please feel free to ask.
Thanks,
Eileen Zhao
March 28th, 2011 9:09am