SSRS 2022 — Why don't parameters work anymore?

Sean Redmond 0 Reputation points
2023-10-17T07:45:50.9833333+00:00

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:

  1. I create a simple report with lists the entries from a date tally table. It looks like this:

User's image

  1. I create a parameter called @YearPicked

User's image

  1. I specify some years under Available Values

User's image

  1. I specify a year under Default Value

User's image

  1. Under Advanced, this checkbox is worrying because Report Parts are no longer supported in SSRS 2022. But what replaces them?

User's image

  1. I now have a parameter for 4 years.

User's image

  1. I insert the parameter into my query in the dataset

User's image

  1. ... making sure to assign the variable to the parameter under Parameters

User's image

  1. I go back to the query screen and press the Refresh Fields button and I get this ominous window.

User's image

  1. And then the inevitable Must declare scalar variable "@YearPicked". error message.

User's image

  1. Needless to say, the report won't run in Preview mode

User's image

  1. This worked without problems in SSRS 2016. Where's the problem here?

Now, there is warning in Microsoft Learn about Report Parts:User's image

https://learn.microsoft.com/en-us/sql/reporting-services/report-design/report-parts-report-builder-and-ssrs?view=sql-server-ver16

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.

https://learn.microsoft.com/en-us/sql/reporting-services/report-design/report-parameters-report-builder-and-report-designer?view=sql-server-ver16

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.

SQL Server Reporting Services
SQL Server Reporting Services
A SQL Server technology that supports the creation, management, and delivery of both traditional, paper-oriented reports and interactive, web-based reports.
3,034 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.