IPivotTableHeader.ContainsKey

Fore Syntax

ContainsKey(SlotNumber: Integer; DimensionKey: Integer): Boolean;

Fore.NET Syntax

ContainsKey(SlotNumber: integer; DimensionKey: uinteger): boolean;

Parameters

SlotNumber. Slot index in the table header.

DimensionKey. Dimension key contained in the table header.

Description

The ContainsKey method determines whether the dimension with the specified key is present in the table header slot.

Fore Example

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(010127) = 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.

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore example.

Imports Prognoz.Platform.Interop.Express;
Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.Pivot;

Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    Report: IEaxAnalyzer;
    Pivot: IPivot;
    TableHeader: IPivotTableHeader;
Begin
    
// Get the current repository
    MB := Params.Metabase;
    
// 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(010127) = True Then
        System.Diagnostics.Debug.WriteLine(
"Dimension with the 10127 key is present in the table header");
        
Else System.Diagnostics.Debug.WriteLine("Dimension with the 10127 key is not present in the table header");
    
End If;
End Sub;

See also:

IPivotTableHeader