How to set the value of a parameter that is passed via a URL

  • I may have had this originally in the wrong forum. I found this category, so I will try here.

    I have been looking of a good example of how to accept a parameter value in SSRS via a URL but I cant find an example that fits.

    A URL carries the Parm value.  I can find examples of how to put a parm value in a URL, but I cannot find an SSRS example of how to accept this passed parm into the waiting parameter in SSRS.

    The stored Procedure that is used as the dataset into the report needs this parameter.

    Essentially  we need the ability to pull the parameter from the URL and assign it to the parameter in the SSRS report.   I can't find in Visual Studio where to set (or link) the parm to the url.   Thanks for your time.

    • This topic was modified 3 years, 2 months ago by  mikek4030.
  • You don't do anything specific to 'accept' a parameter via URL.  You create a parameter in the report - and tie that parameter in the report to the stored procedure call.

    Once you have the report working so that entering data in the report parameter and executing the report works as expected - then when you pass the parameter by URL it will run the report with that parameter.  You don't have to 'pull' the parameter from the URL - SSRS does that for you.

    Jeffrey Williams
    “We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”

    ― Charles R. Swindoll

    How to post questions to get better answers faster
    Managing Transaction Logs

  • If you're talking about passing a URL as a parameter, and then parsing a substring from that URL to use as the stored procedure parameter, then you would need to define an expression to return the substring of the URL that you are using as a stored-procedure parameter (cast to the right type if not varchar/string), and use that expression as the Parameter Value in the Dataset Properties.

    Duplicate of https://www.sqlservercentral.com/forums/topic/ssrs-passing-parameter-via-a-url#post-3837743, where OP clarified:

    YEs, our URL contains an encrypted emp id that the user can't read.  We want to pass that to the SSRS report and use it as one of the parameters in the report. I've been hunting for the answer. I find sites that tell you how to pass the parameter, but not how to handle it on the SSRS end.

  • Thanks Jeffery,

    Yesterday late afternoon, I discovered just what you said. It is working now.  Thank you

  • Thanks ratbak,

    I was able to assign a name to the parameter in the string. As long as the name matched the one in my parameter section it found it. And as long as it matched the SP parameter it found it's way.

    Thank you

Viewing 5 posts - 1 through 4 (of 4 total)

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