This sample illustrates how you can allow your end-user to choose from a list of values for a report's parameters in Print Preview.
In this sample, the list of values is provided to a parameter dynamically, based on the underlying datasource.
See also: How to assign a list of static values to a report parameter.
Example Comments
Added By: Gabriel Vonlanten C. Lopes at: 10/25/2012 2:19:56 PM
Im having an issue with this approach.
I have in my report a BindingSource that is setted as the DataSource for the report, and i have a custom method that provides data to the DataSource of the report, so i dont need any DataAdapter (it is set to null)
When i try to set the DynamicListLookupSetting (using the EUD as if i was and end-user, running the application), i need to set up the DataMember, but it happens that i dont want any data member, i want the parameter to be in the same context as my datasource and not inside one member. With this, i cannot provide the ValueMember and DisplayMember correctly.
Here is a example, suppose i have as the source of my report a List<SomeClass>
here is SomeClass
public class SomeClass
{
public string Id { get; set; }
public string Name { get; set; }
public List<Orders> Orders { get; set; }
}
And inside my report i show all the "Orders" of one SomeClass only, and i want to filter by this class and show to the user the parameters with the List of available SomeClass instance.
Since my report source is already the List<SomeClass> o should be able to just set the DynamicListLookupSetting DataSource to my DataSource, and select the Value and Display members, but it is not possible, how could i override or correct this behavior?
Thanks