StaticListLookUpSettings.LookUpValues Property

Stores a report parameter’s list of static values.

Namespace: DevExpress.XtraReports.Parameters

Assembly: DevExpress.Printing.v21.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.UI;
using System;
using System.Collections.Generic;
// ...
void CreateDateParameter()
{
    XtraReport report = new XtraReport();

    Parameter myDateParameter = new Parameter();
    myDateParameter.Name = "myDateParameter";
    // Sets the Visible property to true to request the parameter value from users.
    // Sets this property to false to apply the parameter's value that is specified in code.
    myDateParameter.Visible = true;
    myDateParameter.Type = typeof(System.DateTime);
    // Specifies 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);
    // Filters report data by the specified parameter.
    report.FilterString = "GetDate([OrderDate]) >= ?myDateParameter";
}

The following code snippets (auto-collected from DevExpress Examples) contain references to the LookUpValues property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also