Mode: EaxDataDrillMode;
The Mode property determines selection modification mode in dimension elements detailing.
The property is set to EaxDataDrillMode.None by default.
Executing the example requires that the repository contains a regular report with the REG_MODE identifier. Data source is a cube where calendar dimension is. The report contains one sheet, on which an analytical data area is created.
Add links to the Dimensions, Express, Metabase, Pivot, Report, Tab system assemblies.
Sub UserProc;
Var
MB: IMetabase;
Rep: IPrxReport;
PivSlice: IEaxDataAreaPivotSlice;
Pivot: IPivot;
HeadSets: IDataAreaHeaderSettingsBase;
Grid: IEaxGrid;
DimSettings: IEaxGridDimensionSettings;
PivotDims: IPivotDimension;
DimModel: IDimensionModel;
DimIndex: IDimIndex;
Attributes: IDimAttributesInstance;
Attribute: IDimAttribute;
Drill: IEaxDrillSettings;
Begin
// Get repository
MB := MetabaseClass.Active;
// Get regular report
Rep := MB.ItemById("REG_MOVE").Edit As IPrxReport;
// Get data slice as a data area of report table
PivSlice := Rep.DataArea.Slices.Item(0) As IEaxDataAreaPivotSlice;
// Get data table
Pivot := PivSlice.Pivot;
// Get calendar dimension
PivotDims := Pivot.Dimensions.Item(1);
// Get dimension structure
DimModel := PivotDims.DimInstance.Dimension;
// Get structure of specified dimension index
DimIndex := DimModel.Indexes.Item(0);
// Get collection of dimension attributes
Attributes := PivotDims.DimInstance.Attributes;
// Get structure of specified attribute
Attribute := Attributes.Item(0).Attribute;
// Get settings of analytical data area header
HeadSets := PivotDims As IDataAreaHeaderSettingsBase;
// Enable settings of detailing for specified view
Grid := (PivSlice As IEaxDataAreaSlice).Views.Item(0) As IEaxGrid;
Grid.ViewSettings.HyperlinkAsText := False;
DimSettings := Grid.ViewSettings.GetViewSettings(HeadSets) As IEaxGridDimensionSettings;
If Not DimSettings.IsDrilled Then
DimSettings.Drilled := TriState.OnOption;
End If;
// Get detailing settings
Drill := DimSettings.Drill;
// Set sheet
Drill.SheetKey := Rep.Sheets.Item(0).Key;
// Determine dimension
Drill.Dimension := PivotDims;
// Set selection modification mode - replace
Drill.Mode := EaxDataDrillMode.Replace;
// Set index for elements search
Drill.DimensionIndex := DimIndex;
// Set search attribute in index
Drill.DimensionAttribute := Attribute;
Drill.DimensionAttributes := "BLOCK_TYPE";
// On clicking the hyperlink the specified site will open
// The link opens in new browser window
Drill.ActionType := TabHyperlinkActionType.OpenURL;
Drill.Action := "www.example.com";
Drill.Target := TabHyperlinkTarget.Top;
// Display to the console data slice key and dimension key
Debug.WriteLine("Data slice key = " + Drill.SliceKey.ToString);
Debug.WriteLine("Dimension key = " + Drill.DimensionKey.ToString);
// Refresh report and save changes
Rep.Recalc;
(Rep As IMetabaseObject).Save;
End Sub UserProc;
After executing the example:
Dimension elements detailing will be used for the specified regular report.
On clicking the dimension element, you will be directed by specified hyperlink.
See also: