Migrating Reports from SQL Server 2014 to SQL Server 2022 via Visual Studio 2022

  • Migrating Reports from SQL Server 2014 to SQL Server 2022 via Visual Studio 2022 with Reporting Services extension installed.

    I am having trouble with parameters and the error message: "Must declare the scalar variable @TellMeWhyIdontlikeThisMonday".

    I'm also getting the error message: "Custom parameter layout was removed from the report. SQL Server 2014 Reporting Services and earlier do not support custom parameter layout." I'm not sure whether this error message is relevant.

    First of all, I have installed the Microsoft Reporting Services Projects from here. It is running on Visual Studio 2022 Community Edition.

    I can not open a project of type Reporting Services so I opened a copy of a 2014 Reporting Services solution. I create a new .rdl file under reports, configure a data source and define a dataset. The data set returns a date tally table. I create a table and copy across a column. It runs without error.

    Then I create a parameter of data type: Date/Time, give it a name (TellMeWhyIdontlikeMondays) and nothing more.

    I add the parameter to the query in the dataset Query box, assign a mapping in Parameters between the variable & the parameter.

    Parameters

    I go back to Query, press the Refresh Fields button and I get an error message telling me why it couldn't update the list of fields for the query. The error message is: "Must declare the scalar variable @TellMeWhyIdontlikeThisMonday".

    Must Declare Variable

    This worked fine in Reporting Services 2014. The Microsoft Learn pages for Reporting Services say it works in Report Builder but also give an ominous warning that Report Parts are deprecated starting with SQL Server 2019. Parameters are Report Parts. They don't actually state what replaces them.

    Report Parts

    So, what am I doing wrong? What am I missing out on? How can I use a parameter in the script in SSRS 2022?

    I would be very happy if someone would point me in the right direction here. It can't be that SSRS 2022 doesn't support parameters anymore.

  • Thanks for posting your issue and hopefully someone will answer soon.

    This is an automated bump to increase visibility of your question.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply