ContainsKey(SlotNumber: Integer; DimensionKey: Integer): Boolean;
SlotNumber. Slot index in the table header.
DimensionKey. Dimension key contained in the table header.
The ContainsKey method determines whether the dimension with the specified key is present in the table header slot.
Executing the example requires that the repository contains an express report with a data table with the EXPRESS_SLOTS identifier.
Add links to the Express, Metabase, Pivot system assemblies.
Sub UserProc;
Var
MB: IMetabase;
Report: IEaxAnalyzer;
Pivot: IPivot;
TableHeader: IPivotTableHeader;
Begin
// Get the current repository
MB := MetabaseClass.Active;
// Get express report
Report := MB.ItemById("EXP_SLOTS").Bind As IEaxAnalyzer;
// Get object, based on which data table is built
Pivot := Report.Pivot;
// Get properties of table column headers
TableHeader := Pivot.ObtainTable.TopHeader;
// Check if the dimension with the 10127 key is present in the first header slot
If TableHeader.ContainsKey(0, 10127) = True Then
Debug.WriteLine("Dimension with the 10127 key is present in the table header");
Else Debug.WriteLine("Dimension with the 10127 key is not present in the table header");
End If;
End Sub UserProc;
After executing the example the console window displays the message whether the dimension with the specified key is present in the table header.
See also: