LookUpHelper Class

Enables you to obtain parameter values that were selected in the look-up editor.

Namespace: DevExpress.XtraReports.Parameters

Assembly: DevExpress.Printing.v20.1.Core.dll

Declaration

public static class LookUpHelper
Public Module LookUpHelper

Remarks

The following code illustrates how to display the currently selected values of a multi-value parameter in a report.


using DevExpress.Data.Browsing;
using DevExpress.XtraPrinting.Native;
using DevExpress.XtraReports.UI;
using System;
// ...

private void XtraReport1_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e) {
    var text = "";
    var lookupValues = DevExpress.XtraReports.Parameters.LookUpHelper.GetLookUpValues(
        this.Parameters["parameter1"].LookUpSettings, ((XtraReport)sender).GetService<DataContext>());
    var categoriesArray = (Int64[])this.Parameters["parameter1"].Value;
    int step = 0;
    for (var j = 0; j < lookupValues.Count; j++) {
        if (Array.IndexOf(categoriesArray, Convert.ToInt32(lookupValues[j].Value)) > -1) { 
            step += 1;
            if (step == categoriesArray.Length) {
                text += lookupValues[j].RealDescription;
            }
            else {
                text += lookupValues[j].RealDescription + ", ";
            }
        }
    }
    xrLabel1.Text = text;
}

Inheritance

Object
LookUpHelper
See Also