-
Notifications
You must be signed in to change notification settings - Fork 211
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
New-RsSubscription does not accept -Parameters argument (and sets it to null) #97
Comments
I'm coding a solution to this now. I will use [hashtable] $Parameters as the new argument to New-RsSubscription I suggest this be a breaking change to the current New-RsSubscription interface, and that once I submit my patch, the overall module get a bump to 0.0.3.x (I'm really unclear on what it means for a project to have 0 for major and minor versions... please consider using semver - semantic versioning scheme popular among Web developers.) |
So, the drawback to [hashtable] $Parameters is that, technically, $Parameters should support Label as well as Name-Value pair elements. I'm not aware of anyone ever actually using that feature, so I'll continue down the [hashtable] path and consider the Label feature over-engineering. |
Actually, the easiest thing to do is create a new function, New-RsSubscriptionParametersXml, similar to New-RsScheduleXml, which will allow us not to expose the full namespace of the SSRS WSDL types and yet keep the overall integrity of the API together. Plus, most people will probably want to use something like XML to manage these externally, anyway. |
I've got this mostly working, but can't find documentation on MSDN for how to say "This report uses default parameters" or "This report uses null valued parameters". I spied the SSRS Reports portal's Rest calls, and they pass an empty list via [] json in both cases. It seems like the SOAP API does things differently, though. |
This is the error message that I'm receiving when trying to add a report subscription for a report that needs some parameters set: Exception occurred while creating subscription! Exception calling "CreateSubscription" with "6" argument(s): |
I have this working in my local fork of the project and need to commit back upstream to avoid losing my changes. The big gotcha is if you export reports with parameters and try to import them back, things get crazy because of how the SSRS team handles default parameters where the default is a null. If someone at Microsoft were to explain this to me, I could probably write a robust integration. |
I have to update my repository to 0.0.4.6 to integrate my change to make sure it works in the latest release of ReportingServicesTools. Here is a snippet of the changes - this should replace
Also, the signature should now say:
|
@jtarquino Is there a better way to code this? This is how I have it working in my production environment, which is a fork of ReportingServicesTools 0.0.2.9. The reason it's so verbose is because of the apparent stupid way SSRS API treats nulls/empty values. It looks like the behavior broke at some point from 2005 to 2016 releases, most likely between 2008 R2 and 2012 releases. |
@jtarquino - Looking for some direction and then I can submit the patch. |
I think your approach is feasible, I would just change the Write-Output by Write-Verbose and avoid the continue in the loop, also probably would extract that logic into a function and add testing |
I am upgrading from 0.0.2.9 this week and plan to finally submit a patch for this to the 0.0.4.7 code. |
@jtarquino MERGED... Tried to keep it as simple as possible but SQL Server 2012+ is very finicky . It works on my side upgrading from 2008 to 2016. |
@wgshef FYI |
I have had to use this last week, one problem I found is that the Hash approach does not allow to use multivalue parameters |
Do you want to request a feature or report a bug?
feature
What is the current behavior?
$Parameters is hardcoded to null and there is no API hook exposed to override this hardcoded behavior. See: https://github.com/Microsoft/ReportingServicesTools/blob/master/ReportingServicesTools/Functions/CatalogItems/New-RsSubscription.ps1#L205
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.
I don't think I really need to explain this.
What is the expected behavior?
Feature parity with CreateSubscription SSRS WSDL endpoint.
Which versions of Powershell and which OS are affected by this issue? Did this work in previous versions of our scripts?
The text was updated successfully, but these errors were encountered: