Skip to main content

StaticListLookUpSettings.LookUpValues Property

Stores a report parameter’s list of static values.

Namespace: DevExpress.XtraReports.Parameters

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

NuGet Package: DevExpress.Printing.Core

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";
}
See Also