Show contents 

Express > Express Assembly Interfaces > IEaxDrillSettings > IEaxDrillSettings.OpenObjectContext

IEaxDrillSettings.OpenObjectContext

Syntax

OpenObjectContext: IEaxOpenObjectContext;

Description

The OpenObjectContext property returns the settings sent to the opened object.

Comments

It is relevant if the opened object is a regular report.

To use the sent settings, a parameter with the REPORT_OPEN_CONTEXT identifier should be created in the report. The settings in the XML format determined in the OpenObjectContext property will be sent to this parameter. If custom settings are sent, they can be handled in an application macro of the opened report.

Example

Executing the example requires that the repository contains an express report with the EXPRESS_REPORT identifier and a regular report with the REPORT identifier.

Add links to the Dimensions, Express, Metabase, Pivot, Report, Tab, Xml system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    Eax: IEaxAnalyzer;
    PivSlice: IEaxDataAreaPivotSlice;
    Pivot: IPivot;
    HeadSets: IDataAreaHeaderSettingsBase;
    Grid: IEaxGrid;
    DimSettings: IEaxGridDimensionSettings;
    PivotDims: IPivotDimension;
    DimModel: IDimensionModel;
    DimIndex: IDimIndex;
    Attributes: IDimAttributesInstance;
    Attribute: IDimAttribute;
    Drill: IEaxDrillSettings;
    OpenContext: IEaxOpenObjectContext;
    XMLDoc: IXMLDOMDocument;
    XMLElem: IXMLDOMElement;
Begin
    // Get repository
    MB := MetabaseClass.Active;
    // Get regular report
    Eax := MB.ItemById("EXPRESS_REPORT").Edit As IEaxAnalyzer;
    // Get data slice as a data area of report table
    PivSlice := Eax.DataArea.Slices.Item(0As IEaxDataAreaPivotSlice;
    // Get data table
    Pivot := PivSlice.Pivot;
    // Get dimension
    PivotDims := Pivot.Dimensions.Item(1);
    // Get dimension structure
    DimModel := PivotDims.DimInstance.Dimension;
    // Get structure of the specified dimension index
    DimIndex := DimModel.Indexes.Item(0);
    // Get collection of dimension attributes
    Attributes := PivotDims.DimInstance.Attributes;
    // Get structure of the specified attribute
    Attribute := Attributes.Item(0).Attribute;
    // Get analytical data area header settings
    HeadSets := PivotDims As IDataAreaHeaderSettingsBase;
    // Enable territory info settings for the specified view
    Grid := (PivSlice As IEaxDataAreaSlice).Views.Item(0As IEaxGrid;
    Grid.ViewSettings.HyperlinkAsText := False;
    DimSettings := Grid.ViewSettings.GetViewSettings(HeadSets) As IEaxGridDimensionSettings;
    If Not DimSettings.IsDrilled Then
        DimSettings.Drilled := TriState.OnOption;
    End If;
    // Get territory info settings
    Drill := DimSettings.Drill;
    // Specify sheet
    Drill.SheetKey := Eax.Sheets.Item(0).Key;
    // Specify dimension
    Drill.Dimension := PivotDims;
    // Set method for changing selection - replacement
    Drill.Mode := EaxDataDrillMode.Replace;
    // Set index for element search
    Drill.DimensionIndex := DimIndex;
    // Set attribute of search in index
    Drill.DimensionAttribute := Attribute;
    // Clicking hyperlink opens regular report
    Drill.ActionType := TabHyperlinkActionType.OpenObject;
    Drill.Action := "REPORT";
    OpenContext := Drill.OpenObjectContext;
    OpenContext.ActiveSheetKey := 2;
    OpenContext.EnableUserData := True;
    XMLDoc := New FreeThreadedDOMDocument60.Create;
    XMLElem := XMLDoc.createElement("Root");
    XMLDoc.appendChild(XMLElem);
    OpenContext.ExternalXML := XMLDoc.documentElement;
    // Save settings
    OpenContext.SaveToXml(XMLElem);
    XMLDoc.save("D:\OpenObjectContext.xml");
    Eax.RefreshAll;
    (Eax As IMetabaseObject).Save;
End Sub UserProc;

After executing the example, drill down is set up for express report dimension. A regular report opens on the second sheet on clicking on elements. The custom data that can be handled in an application macro will also be sent to the report. The settings sent to the opened object will be saved to an XML file.

See also:

IEaxDrillSettings