IPrxOpenObjectDimAttributeParamControl.DimId

Syntax

DimId: String;

Description

The DimId property determines identifier of the dimension, from which attribute values will be taken.

Comments

As a property value, specify any data area dimension contained in the current regular report.

Example

Executing the example requires that the repository contains two regular reports with the REPORT and REPORT_ADD identifiers. A data area is created in the REPORT report, which data source has a dimension with the COUNTRY identifier.

The file system should contain the button image file D:\Work\Image\btn16x16.png.

Add links to the IO, Metabase, and Report system assemblies.

Sub UserProc;
Var
    Mb: IMetabase;
    Report: IPrxReport;
    UserBtn: IPrxUserButton;
    OpenObjAction: IPrxUserButtonActionOpenObject;
    ObjParam: IPrxOpenObjectParam;
    ParamControl: IPrxOpenObjectDimAttributeParamControl;
    Sheets: Array Of Integer;
Begin
    Mb := MetabaseClass.Active;
    Report := Mb.ItemById("REPORT").Edit As IPrxReport;
    // Create a new custom button
    UserBtn := Report.UserButtons.AddByType(PrxUserButtonType.OpenObject);
    UserBtn.Name := "Open object";
    // Set up custom button
    UserBtn.Icon := New FileStream.Create("d:\Work\Image\btn16x16.png", FileOpenMode.Read, FileShare.DenyNone);
    UserBtn.IconType := "png";
    UserBtn.SmallIcon := False;
    // Set up actions
    OpenObjAction := UserBtn.Action As IPrxUserButtonActionOpenObject;
    OpenObjAction.ObjectForOpen := Mb.ItemById("REPORT_ADD");
    OpenObjAction.OpenInModal := True;
    Sheets := New Integer[1];
    Sheets[0] := 1;
    OpenObjAction.SheetsForRefresh := Sheets;
    // Set up parameters binding
    ObjParam := OpenObjAction.Params.Item(0);
    ObjParam.Type := PrxOpenObjectParamType.DimensionAttribute;
    ParamControl := (ObjParam.Control As IPrxOpenObjectDimAttributeParamControl);
    ParamControl.DimId := "COUNTRY";
    ParamControl.Attribute := "KEY";
    ParamControl.SelectionType := PrxOpenObjectSelectionType.First;
    // Save changes
    (Report As IMetabaseObject).Save;
End Sub UserProc;

After executing the example a new custom button is created in the REPORT regular report. Name, image, and list of updated sheets will be set for the button. Object opening will be selected as a custom button action. The key of the first element selected in the COUNTRY dimension of the data area will be sent to the opened object parameter.

See also:

IPrxOpenObjectDimAttributeParamControl