Search code examples
c#reporting-servicesssrs-2008

Generic Getting parameters from ssrs Report


After long and frustrating google search I have come here in search for help. I'm making a fun little program that get feed a URL for a SSRS report and (if it is even possible) gets all the parameters names that the report accepts, so that the user can fill them in. But I haven been successful in finding any information on how to get these parameters.

I know you can just use the GUI that the report spits out into the browser, but I need the names specifically. Also the GUI is for the user, but the program is mean to function as a sort of Data fetcher for another program so no user interaction is supposed to happen.

To make this even more frustrating the reports I need are made by a 3rd party company so i don't have access to the code

Is this at all possible? When I google all I get as a response is how to fill the parameters into the URL when I have them, not how to get them.

I hope some of you can point me in the right direction


Solution

  • You can get the parameters report use the ServerReport.GetParameters () method

    Returns report parameter properties for the report.

    This method returns a ReportParameterInfoCollection object

    Try this code:

    ReportParameterInfoCollection parameters = ReportViewerViewReport.ServerReport.GetParameters();
    foreach (ReportParameterInfo parameter in parameters)
    {
        name = parameter.name;
    }
    

    Let me know if this was helpful.