How does one specify a different data source folder path when deploying a
report to a report server (2005) using RS scripting? I started with the
PublishSampleReport.rss script sample from microsoft and need to publish a
report (i.e. rs.CreateReport... ) to the report server that references the
shared data source in a different folder than the default "/Data Sources"
(i.e. /ApplicationName/ReleaseName/Data Sources). Any ideas? You can
change in Visual Studio 2005 the TargetDataSourceFolder in the project
properties for deployment, but how do you do it in script?I think something like this should do the trick (it's worked for me):
Private Sub SetItemDataSources()
Dim Item As String = "/My Reports/MyReport"
Dim DataSources(0) As Microsoft.SqlServer.ReportingServices2005.DataSource
DataSources(0) = New Microsoft.SqlServer.ReportingServices2005.DataSource
DataSources(0).Name = "MyDataSource"
Dim Item1 As Microsoft.SqlServer.ReportingServices2005.DataSourceReference
= New Microsoft.SqlServer.ReportingServices2005.DataSourceReference
Item1.Reference = "/Data Sources/MyDataSource"
DataSources(0).Item = Item1
RS.SetItemDataSources(Item, DataSources)
End Sub
I find it pretty useful to use the "script" option in in SQL Server
Management Studio (connected to Reporting Services rather than the Database
Engine) when I want to see how to make a particular change using RS. That's
how I got the above example.
Regards.
"vnapoli" wrote:
> How does one specify a different data source folder path when deploying a
> report to a report server (2005) using RS scripting? I started with the
> PublishSampleReport.rss script sample from microsoft and need to publish a
> report (i.e. rs.CreateReport... ) to the report server that references the
> shared data source in a different folder than the default "/Data Sources"
> (i.e. /ApplicationName/ReleaseName/Data Sources). Any ideas? You can
> change in Visual Studio 2005 the TargetDataSourceFolder in the project
> properties for deployment, but how do you do it in script?
>
>
No comments:
Post a Comment