SSRS 2022 — Why don't parameters work anymore?
I am in the process of migrating reports manually from a server with SSRS 2016 to a server with SSRS 2022.
I am using Visual Studio Community Edition 2022 (64-bit) version 17.7.0 with the SQL Server Reporting Services (v 16.0.20523.0) extension.
Parameters do not work anymore. Let me give an example:
- I create a simple report with lists the entries from a date tally table. It looks like this:
- I create a parameter called @YearPicked
- I specify some years under Available Values
- I specify a year under Default Value
- Under Advanced, this checkbox is worrying because Report Parts are no longer supported in SSRS 2022. But what replaces them?
- I now have a parameter for 4 years.
- I insert the parameter into my query in the dataset
- ... making sure to assign the variable to the parameter under Parameters
- I go back to the query screen and press the Refresh Fields button and I get this ominous window.
- And then the inevitable Must declare scalar variable "@YearPicked". error message.
- Needless to say, the report won't run in Preview mode
- This worked without problems in SSRS 2016. Where's the problem here?
Now, there is warning in Microsoft Learn about Report Parts:
My understanding of the word deprecated is that it means that it will be removed sometime in the future and that this feature should still be active.
How should I be creating parameters so as to avoid creating Report Parts?
The entry on Report Parameters is long, rambling and confusing.
Either way, Microsoft doesn't make it clear what should be used for parameters instead of Report Parts.
I would appreciate some help because I am looking at having to remove the parameters from my SSRS 2016 reports and make one report per hard-coded parameter, which is rather shitty.