I am trying to do the same, establish a simple list of parameter values from the report code. None of the links in any of these answers shows how to do this, and after quite a bit of digging, I don't think this is possible. Yes, you can get values from a database query, from a web service, or from a custom assembly, but each of them creates a lot of overhead compared to getting a list from a simple function call, for example = Code.GetValues (), where the function uses a For loop to create values.
msvcyc is right to indicate that the parameter expects a string value, but the function returns an array. I changed the return type to Array, as suggested by prashant sable, but the select list is still inactive, it does not work. And the common cold is right in saying that the access modifier must be publicly available.
In my digging, I found an article by James Kovacs from 2005, which indicated why this is not possible. The Parameters class has a get method, but no method is set. In VS 2008 Object Explorer for SSRS 2008, the name of the object has changed, but it still does not contain the installed method (see Microsoft.ReportingServices.Interfaces.IParameter.Name or .Value).
My current workaround is to simply copy the list of values, but if your list of values needs to be dynamic, then your only options could be database queries, web services, or custom assemblies. I think the easiest workaround for these three is to get the values from the database engine, as suggested by oleksiy.t, if you can write a query to return the list of values you need. Your list of integers or my list of time intervals will be easy queries to write. Otherwise, you will need to use one of two workarounds.
Bratch
source share