timabell / ssrs-powershell-deploy

PowerShell scripts to deploy a SQL Server Reporting Services project (*.rptproj) to a Reporting Server
MIT License
75 stars 40 forks source link

report fails to deploy "Invalid data source reference" #2

Closed timabell closed 9 years ago

timabell commented 9 years ago

sanitized error:

Invalid data source reference 'SomeDataSource' in SomeReport.rdl
At C:\repo\ssrs-powershell-deploy\Deploy-SSRSProject.ps1:274 char:6
+                     throw "Invalid data source reference '$($_.DataSourceReference)' in $RdlPat ...
+                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (Invalid data so...sing Report.rdl:String) [], RuntimeException
    + FullyQualifiedErrorId : Invalid data source reference 'SomeDataSource' in SomeReport.rdl

the shared dataset & datasource it relies on has already been deployed

timabell commented 9 years ago

this report has a direct reference to the main DataSource of the project

timabell commented 9 years ago

nothing to do with shared datasets, breaks even if there aren't any.

timabell commented 9 years ago

well that's odd, stepping through on the first run the return value from New-SSRSDataSource seems messed up during the return

https://github.com/timabell/ssrs-powershell-deploy/blob/6c7468a735fd6d35fff2cb0b536cbb1065f1b2b3/Deploy-SSRSProject.ps1#L145

inspecting within the function gives

$DataSource = @{Name=GLiMR; Path=/GLiMR Reports/FtT Tax/Data Sources/GLiMR}

but when the return is assigned to a powershell variable it's suddenly:

$DataSource = System.Object[]
> [0] = SSRS.ReportingService2010.CatalogItem
> [1] = @{Name=GLiMR; Path=/GLiMR Reports/FtT Tax/Data Sources/GLiMR}
timabell commented 9 years ago

oh ffs http://stackoverflow.com/questions/23225037/powershell-v2-function-returns-system-object-instead-of-pscustomobject