Skip to main content
A newer version of this page is available. .

StaticListLookUpSettings.LookUpValues Property

Stores a report parameter’s list of static values.

Namespace: DevExpress.XtraReports.Parameters

Assembly: DevExpress.Printing.v19.2.Core.dll

Declaration

public virtual LookUpValueCollection LookUpValues { get; }

Property Value

Type Description
LookUpValueCollection

A list of a report parameter’s static values.

Remarks

The static list of predefined values stored in this property is displayed in the parameter’s editor in Print Preview if the parameter is visible.

The parameter’s editor lists predefined values in the order that they appear in the LookUpValues collection. Manipulate the collection to change the order.

Example

The code sample below illustrates how to create a date parameter with a static list of predefined values and filter report data by this parameter.

using DevExpress.XtraReports.Parameters;
using DevExpress.XtraReports.Expressions;
// ...
XtraReport1 report = new XtraReport1();

Parameter myDateParameter = new Parameter();
myDateParameter.Name = "myDateParameter";
// Set the Visible property to true to request the parameter value from users.
// Set this property to false to apply the parameter's value that is specified in code.
myDateParameter.Visible = true;
myDateParameter.Type = typeof(System.DateTime);
// Specify the parameter's static list of predefined values
StaticListLookUpSettings lookupSettings = new StaticListLookUpSettings();
lookupSettings.LookUpValues.Add(new LookUpValue(new DateTime(2019,01,01), "January 1, 2019"));
lookupSettings.LookUpValues.Add(new LookUpValue(new DateTime(2019,02,01), "February 1, 2019"));
lookupSettings.LookUpValues.Add(new LookUpValue(new DateTime(2019,03,01), "March 1, 2019"));
lookupSettings.LookUpValues.Add(new LookUpValue(new DateTime(2019,04,01), "April 1, 2019"));
lookupSettings.LookUpValues.Add(new LookUpValue(new DateTime(2019,05,01), "May 1, 2019"));
lookupSettings.LookUpValues.Add(new LookUpValue(new DateTime(2019,06,01), "June 1, 2019"));
lookupSettings.LookUpValues.Add(new LookUpValue(new DateTime(2019,07,01), "July 1, 2019"));
lookupSettings.LookUpValues.Add(new LookUpValue(new DateTime(2019,08,01), "August 1, 2019"));
lookupSettings.LookUpValues.Add(new LookUpValue(new DateTime(2019,09,01), "September 1, 2019"));
lookupSettings.LookUpValues.Add(new LookUpValue(new DateTime(2019,10,01), "October 1, 2019"));
lookupSettings.LookUpValues.Add(new LookUpValue(new DateTime(2019,11,01), "November 1, 2019"));
lookupSettings.LookUpValues.Add(new LookUpValue(new DateTime(2019,12,01), "December 1, 2019"));
myDateParameter.ValueSourceSettings = lookupSettings;
report.Parameters.Add(myDateParameter);
// Filter report data by the specified parameter.
report.FilterString = "GetDate([OrderDate]) >= ?myDateParameter";
See Also