Current filter:
                                You should refresh the page.

                                How to assign a list of dynamic values to a report parameter

                                0

                                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.

                                • 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

                                You must  log in  or  register  to leave comments
                                Select file
                                • Form1.cs
                                • XtraReport1.cs
                                Select language
                                • C#
                                • VB.NET
                                Select version
                                • v2012 vol 1.4 - v2013 vol 1.2
                                using System;
                                using System.Windows.Forms;
                                using DevExpress.XtraReports.UI;
                                // ...
                                
                                namespace DynamicParameterValues {
                                    public partial class Form1 : Form {
                                        public Form1() {
                                            InitializeComponent();
                                        }
                                
                                        private void button1_Click(object sender, EventArgs e) {
                                            XtraReport1 report = new XtraReport1();
                                            ReportPrintTool pt = new ReportPrintTool(report);
                                            pt.AutoShowParametersPanel = true;
                                            pt.ShowPreviewDialog();
                                        }
                                    }
                                }