DisplayUserTextAttr: String;
The DisplayUserTextAttr determines value of the DISPLAYUSERTEXTATTR parameter in the binding string.
The DISPLAYUSERTEXTATTR parameter determines a custom template that will be used to create names of elements for displayed value. The displayed value is available after selecting dictionary elements and closing the dictionary. Parameter value is a string that can contain any text and attribute substitutions. The attribute substitution looks as follows: %Attribute identifier%. The attributes, for which openness attribute is not set, are available for use. The example:
DISPLAYUSERTEXTATTR = "Name: %NAME% (Date: %USER_DATE_ATTR%)"
In the Value Editor Parameters dialog box specify the value of this parameter using the Displayed Attribute parameter.
Executing the example requires that the repository contains a regular report with the REGULAR_REPORT identifier and a dictionary with the DIMENSIONS identifier.
Add links to the Metabase, Report and Tab system assemblies.
Sub UserProc;
Var
MB: IMetabase;
Report: IPrxReport;
BM: IBindingManager;
DimComboBinding: IBindingDimCombo;
Tab: ITabSheet;
Style: ITabCellStyle;
Binding: IBindingValue;
Begin
// Get the current repository
MB := MetabaseClass.Active;
// Get regular report
Report := MB.ItemById("REGULAR_REPORT").Edit As IPrxReport;
// Get cell style in upper left corner of active report sheet
Tab := (Report.ActiveSheet As IPrxTable).TabSheet;
Style := Tab.Cell(0, 1).Style;
// Create and set up value editor as a drop-down list
BM := New BindingManager.Create;
Binding := BM.CreateByUi("DimCombo");
DimComboBinding := Binding As IBindingDimCombo;
DimComboBinding.Object := "DIMENSIONS";
DimComboBinding.DisplayUserTextAttr := "%KEY%";
Style.Binding := DimComboBinding.AsString;
// Save changes
(Report As IMetabaseObject).Save;
End Sub UserProc;
After executing the example the value editor is set for the B0 cell in the regular report as a dictionary drop-down list with custom names of elements of the %KEY% displayed attribute.
See also: