All docs
V21.2
21.2
21.1
The page you are viewing does not exist in version 21.1. This link will take you to the root page.
20.2
The page you are viewing does not exist in version 20.2. This link will take you to the root page.
20.1
The page you are viewing does not exist in version 20.1. This link will take you to the root page.
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.

LookUpHelper.GetLookUpValues(ValueSourceSettings, DataContextBase, IParameterEditorValueProvider) Method

Returns a collection of parameter look-up values.

Namespace: DevExpress.XtraReports.Parameters

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

Declaration

public static LookUpValueCollection GetLookUpValues(
    ValueSourceSettings valueSourceSettings,
    DataContextBase dataContext,
    IParameterEditorValueProvider parameterValueProvider = null
)

Parameters

Name Type Description
valueSourceSettings ValueSourceSettings

Settings for a source of the parameter look-up values.

dataContext DevExpress.Data.Browsing.DataContextBase

A DataContext object.

Optional Parameters

Name Type Default Description
parameterValueProvider IParameterEditorValueProvider

null

An object that implements the IParameterEditorValueProvider interface.

Returns

Type Description
LookUpValueCollection

A collection of parameter look-up values.

Example

The following code example demonstrates how to use the GetLookUpValues method of the LookUpHelper class to access look-up values of a multi-value report parameter. The example also shows how to display the descriptions of the selected parameter values in the report’s XRLabel control.

using DevExpress.Data.Browsing;
using DevExpress.XtraReports.Parameters;
using System;
// ...
private void XtraReport1_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e) {
    var valueSourceSettings = this.Parameters["param1"].ValueSourceSettings;
    var dataContext = (sender as IServiceProvider).GetService(typeof(DataContext)) as DataContext;

    var lookupValues = LookUpHelper.GetLookUpValues(valueSourceSettings, dataContext);
    var selectedValues = this.Parameters["param1"].Value as Int32[];

    var text = "";

    int step = 0;
    for (var j = 0; j < lookupValues.Count; j++) {
        if (Array.IndexOf(selectedValues, Convert.ToInt32(lookupValues[j].Value)) > -1) {
            step += 1;
            if (step == selectedValues.Length) {
                text += lookupValues[j].Description;
            } else {
                text += lookupValues[j].Description + ", ";
            }
        }
    }

    xrLabel1.Text = text;
}
See Also