Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

SSRS report powershell script Expand / Collapse
Author
Message
Posted Friday, February 1, 2013 12:28 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Today @ 9:33 AM
Points: 49, Visits: 568

I have SSRS 2008R2 reporting having 3 data sources.

Say reportname = \Marketing\Test.rdl

DataSource name = \Shared DataSources\Data1 , 2 ,3

Now when deploy the report using reports manager upload functionality , after deployment it looses all three connection reference.

is there any powershell script to set again correct datasource for this 1 report.
Post #1414803
Posted Monday, February 4, 2013 8:47 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Today @ 9:33 AM
Points: 49, Visits: 568
Can anyone tell what's missing in this?

-------------------------------------------------------

$reportServerName = "SSRS01"
$currentPath ="/Marketing/test1"

$reportServerUri = "http://{0}/ReportServer/ReportService2010.asmx" -f $reportServerName
$proxy = New-WebServiceProxy -Uri $reportServerUri -Namespace SSRS.ReportingService2010 -UseDefaultCredential


$type =$proxy.GetType().Namespace

$dataSourceArrayType = ($type + '.DataSource[]')
$dataSourceType = ($type +'.DataSource')

$numDataSources = 3

$dataSourceArray = New-Object ($dataSourceArrayType)$numDataSources

$dataSourceArray[0] = New-Object ($dataSourceType)
$dataSourceArray[0].Name = "Marketing1"
$dataSourceArray[0].Item = New-Object ($dataSourceReferenceType)
$dataSourceArray[0].Item.Reference = "/Shared Data Sources/Marketing1"


$dataSourceArray[1] = New-Object ($dataSourceType)
$dataSourceArray[1].Name = "Marketing2"
$dataSourceArray[1].Item = New-Object ($dataSourceReferenceType)
$dataSourceArray[1].Item.Reference = "/Shared Data Sources/Marketing2"

$dataSourceArray[2] = New-Object ($dataSourceType)
$dataSourceArray[2].Name = "Marketing3"
$dataSourceArray[2].Item = New-Object ($dataSourceReferenceType)
$dataSourceArray[2].Item.Reference = "/Shared Data Sources/Marketing3"

$proxy.setItemDataSources ($currentPath,$DataSourceArray)
Post #1415350
Posted Friday, May 17, 2013 3:40 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, June 10, 2013 5:26 AM
Points: 1, Visits: 4
For one, you do not define $dataSourceReferenceType:

$dataSourceReferenceType=New-Object "$ns.DataSourceReference"

What's the output?

Jeroen
Post #1453913
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse