IDefDimension.SetAttributes

Syntax

SetAttributes(attrKeys: IArrayList);

Parameters

attrKeys. Collection of attributes keys.

Description

The SetAttributes method sets the list of attributes displayed for dimension elements.

Example

Executing the example requires that the repository contains a data entry form, for which the specified macro is set as an executable method for a custom button. Table area is created in data entry form. Table area data source in the structure has dimensions with the CALENDAR and DICT_INDICATORS identifiers. The DICT_INDICATORS dimension is also added to table area indicator.

Add links to the Collections, Dimensions, Metabase, Report system assemblies. Add links to the assemblies required for working with data entry forms.

Public Sub SetAttributes(Report: IPrxReport);
Var
    Mb: IMetabase;
    DEForm: IDataEntryForm;
    TArea: IDefTableArea;
    Dim1, Dim2: IDimensionModel;
    Attrs: IDimAttributes;
    attrKeys: IArrayList;
Begin
    Mb := MetabaseClass.Active;
    
// Current data entry form instance    
    DEForm := New DataEntryForm.CreateByReport(report);
    
// Get table area
    TArea := DEForm.inpuTAreas.Item(0As IDefTableArea;
    
// Set up dimension
    attrKeys := New ArrayList.Create;
    Dim1 := Mb.ItemById(
"CALENDAR").Bind As IDimensionModel;
    Attrs := Dim1.Attributes;
    attrKeys.Add(Attrs.FindById(
"NAME").Key);
    attrKeys.Add(Attrs.FindById(
"ID").Key);
    TArea.DefDimensions.ItemByKey(Mb.GetObjectKeyById(
"CALENDAR")).SetAttributes(attrKeys);
    
// Set up indicator
    Dim2 := Mb.ItemById("DICT_INDICATORS").Bind As IDimensionModel;
    Attrs := Dim2.Attributes;
    attrKeys.Clear;
    attrKeys.Add(Attrs.FindById(
"NAME").Key);
    attrKeys.Add(Attrs.FindById(
"KEY").Key);
    TArea.DefIndicators.Item(
0).SetAttributes(attrKeys);
    
// Apply changes to data entry form
    DEForm.inpuTAreas.ApplyAreaToReport(TArea.id);
    DEForm._Dispose;
End Sub SetAttributes;

On executing macro for dimension and indicator of table area, attributes displayed for elements will be set up.

See also:

IDefDimension