-
Notifications
You must be signed in to change notification settings - Fork 499
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem with community step template: Deploy SSRS Reports from a package #190
Comments
Certainly! Let me see if I can do some debugging on my end. To make sure I understand the issue correctly, you have a report that has two datasets; we’ll call them DataSetA and DataSetB. Each dataset uses a different datasource, DataSourceA and DatasourceB. The report is configured like DataSetA -> DataSourceA and DataSetB -> DataSetB. However, when the report gets deployed, DataSetA -> DataSourceB and DataSetB -> DataSourceA? From: Ronnie Overby [mailto:notifications@github.com] @twerthihttps://github.com/twerthi Thanks for the great step template (#150#150) I found an issue with it that I’m trying to fix, but maybe you can help out. When deploying a report with 2 datasets that each target a different shared data source, the targeted data sources get swapped: [image]https://cloud.githubusercontent.com/assets/101028/8852255/fbbce33e-3121-11e5-8e2b-c564be2f38b1.png I think the problem is in the script function Set-ReportDataSources, but I'm weak with powershell, so it's taking me some effort to debug it. Can you lend a hand? — |
Yes, you seem to understand the problem exactly. I did get powershell ISE debugger working and stepped through the script and did verify that the problem is inside the loop in the function called The best fix in my opinion is to look inside the .rdl xml and for the name of the correct datasource to use. Here's an example of another script I found that does just that: https://github.com/timabell/ssrs-powershell-deploy/blob/master/Deploy-SSRSProject/Deploy-SSRSProject.ps1#L220 |
Nice catch! I’ve been using this logic for years and haven’t encountered that issue, but I see what you’re talking about and it is an issue. I attempted to duplicate the problem, but can’t seem to get it to do what you’re seeing. Would it be possible to send me the RDL so that I can ensure that the issue is resolved before declaring it fixed? From: Ronnie Overby [mailto:notifications@github.com] Yes, you seem to understand the problem exactly. I did get powershell ISE debugger working and stepped through the script and did verify that the problem is inside the loop in the function called Set-ReportDataSources. The code is not ensuring that the names match, nor is it ordering both collections before setting the datasource. The best fix in my opinion is to look inside the .rdl xml and for the name of the correct datasource to use. Here's an example of another script I found that does just that: https://github.com/timabell/ssrs-powershell-deploy/blob/master/Deploy-SSRSProject/Deploy-SSRSProject.ps1#L220 — |
You actually exposed two bugs, I found that the Item-Exists method would report a false positive if the item you were looking for exists in a subfolder. I also found the extraction of the datasource names by reading the XML directly was completely unnecessary as the Web Service method of GetItemDataSources gives you the same information. I now check to make sure that datasource name exists in the specified data source location and then create the new reference. Since you have the script running in the ISE, would you be able to test this new version to see if it fixes the issue? Param([string] $DeployedPath) ######################################## DEBUG SECTION$DeployedPath = "c:\temp\reports" #region Upload-Report()
} #region Get-ReportDataSourceNames()
} #region Item-Exists()
} #region Set-ReportDataSources()
} #region Get-ObjectNamespace() #region Get-SpecificEnumValue()
} #region Update-ReportParamters()
} #region Remove-Datasources()
finally #region Copy-ObjectProperties()
for($i = 0; $i -lt $SourcePropertyCollection.Length; $i++)
} #region ConvertValidValues()
} #region Backup-ExistingItem()
} #region Main try
}
} #endregion From: Ronnie Overby [mailto:notifications@github.com] Yes, you seem to understand the problem exactly. I did get powershell ISE debugger working and stepped through the script and did verify that the problem is inside the loop in the function called Set-ReportDataSources. The code is not ensuring that the names match, nor is it ordering both collections before setting the datasource. The best fix in my opinion is to look inside the .rdl xml and for the name of the correct datasource to use. Here's an example of another script I found that does just that: https://github.com/timabell/ssrs-powershell-deploy/blob/master/Deploy-SSRSProject/Deploy-SSRSProject.ps1#L220 — |
Did you have an opportunity to test the new version? |
Unfortunately, no. I've been "redirected" to another project :) I'll try to follow up soon. Thanks again for the speedy response! |
@twerthi Thanks for the great step template (#150)
I found an issue with it that I’m trying to fix, but maybe you can help out.
When deploying a report with 2 datasets that each target a different shared data source, the targeted data sources get swapped:
I think the problem is in the script function
Set-ReportDataSources
, but I'm weak with powershell, so it's taking me some effort to debug it. Can you lend a hand?The text was updated successfully, but these errors were encountered: