Passing parameters in an URL to a report

  • Hi,

    I want to pass a parameter directly in the URL to a report, without querying the user.

    To do this, I have set the report parameters as follows:

    - available values: Non-queried

    - default values: Non-queried, =Globals!ReportServerUrl

    This works fine, but I get the complete URL, not just the parameter (ex: http://localhost/reportserver/folder?test=myvar) How should I parse the parameter value out of here? Where can I write code in SSRS?

    Thanks,

    Jan

  • You shouldn't need to parse the variable out.  SSRS should do it for you.  As long as the Parameter exists, it will be populated from the Query String.

    You shouldn't need to set the default value in this case.  You only need to set the default for when a value is not passed in at all.


    wayne

  • Wayne,

    Thanks, but I do not understand it completely yet. From which query string?

    The URL parameters are not part of a dataset. I tried to do this on your suggestion, and indeed I can add predefined parameters as "calculated fields". There agan I can use "ReportServerURL", but so I'm stuck with the same problem I had before passing it through a dataset.

    Regards,

    Jan

  • If you create a parameter named Test.  You can get it's value by using the following expresion:

    =Parameters!Test.Value

    If you pass it in on the query string SSRS will automatically take it from the URL and update the value in the Parameters collection.


    wayne

  • So, if I have an asp (not ASP.NET) page (let's call it deals) that was displayed using a sproc and that url has the value I want to pass in it, and I want to create a hyperlink to run a report on this deal, how do I pass my variable into my report? In other words my url looks like this:

    http://MyServer/Deals/Deal.asp?DealID=925.

    I want to pass 925 into my report. I can run the report manually and input the 925 into the "Prompt" box, but I want my users to click on the hyperlink and have it pass 925 into my parameter for my stored procedure that gets a dataset for my report. How can this be accomplished? I have my parameter, intDealID, in the report. Do I want to get my values from the 'Default Values' area? I feel like I'm on the 2 yard line, but can't put it in the end zone.

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

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