IDimElements.DisplayAttributeValue

Syntax

DisplayAttributeValue(Element: Integer; AttributeIndex: Integer): Variant;

Parameters

Element - element index.

AttributeIndex - index of the attribute whose displayed value is to be obtained.

Description

The DisplayAttributeValue property returns displayed value of element attribute. Element index and attribute index are passed by the Element and AttributeIndex parameters respectively.

Comments

This property is relevant if the DisplayDifferentValue property returns True for the current attribute.

Example

Executing the example requires an MDM repository with the NSI_1 identifier. This repository contains an MDM dictionary with the Dict_1 identifier.

Sub UserProc;
Var
    MB: IMetabase;
    DictInst: IDimInstance;
    Attrs: IDimAttributesInstance;
    Attr: IDimAttributeInstance;
    Elems: IDimElements;
    Elem: Integer;
Begin
    MB := MetabaseClass.Active;
    DictInst := MB.ItemByIdNamespace("Dict_1", MB.ItemById("NSI_1").Key).Open(NullAs IDimInstance;
    Attrs := DictInst.Attributes;
    Attr := Attrs.Item(Attrs.Count - 1);
    If Attr.DisplayDifferentValue Then
            Elems := DictInst.Elements;
        For Elem := 0 To Elems.Count - 1 Do
            Debug.WriteLine("Actual value: " + Elems.AttributeValue(Elem, 0)
                + "; Displayed value: " + Elems.DisplayAttributeValue(Elem, 0));
        End For;
    End If;
End Sub UserProc;

After executing the example the last attribute created in the MDM directory is checked. If displayed value does not match actual attribute value, development environment console displays both values for all elements.

See also:

IDimElements