Sto provando a modificare le origini dati di più report SSRS con PowerShell a un'origine dati condivisa sul mio server di report. Ecco il mio codice:Cambia origine dati del report SSRS con PowerShell
cls;
$reportserver = "myServer";<br/>
$url = "http://$($reportserver)/reportserver/reportservice2005.asmx?WSDL";";<br/>
$ssrs = New-WebServiceProxy -uri $url -UseDefaultCredential -Namespace "ReportingWebService";
[ReportingWebService.DataSource[]] $myDataSource = new-object ReportingWebService.DataSource
$myDataSource[0].Name = "myDS"";<br/>
$myDataSource[0].Item = New-Object ReportingWebService.DataSourceReference<br/>
$myDataSource[0].Item.Reference = "/Data Sources/MyDS"<br/>
$reports = $ssrs.ListChildren('/DH', $false)
$reports | ForEach-Object {<br/>
$reportPath = $_.path<br/>
Write-Host "Report: " $reportPath<br/>
$dataSources = $ssrs.GetItemDataSources($reportPath)<br/>
$dataSources | ForEach-Object {<br/>
Write-Host "Old source: $($_.Name), $($_.Item.ConnectString)"<br/>
$ssrs.SetItemDataSources($reportPath, $myDataSource)<br/>
Write-Host "New source: $($_.Name), $($_.Item.ConnectString)"<br/>
}<br/>
Write-Host "------------------------"
}
Ma sto ottenendo il seguente errore quando si chiama "SetItemDataSources" -Metodo:
***Argument "1" having the value "ReportingWebService.DataSource[]" of "SetItemDataSources" can not be converted to type "ReportingWebService.DataSource[]".***
La domanda è: cosa c'è che non va? I tipi sono gli STESSI!
mi potete aiutare su questo http://stackoverflow.com/questions/41824616/ssrs-setitemdatasource-giving-exception – Learner