PrepareAction(Dimension: IDimInstance);
Dimension. Dimension used in substitution.
The PrepareAction method prepares action where substitution as dimension attribute is used.
To parse an action and to present it as a text, use the IEaxDrillSettings.ParseAction method.
Executing the example requires that a repository contains express report with the EAX_ACTION identifier. It is required that file system contains images C:\Dim_N.png, where N is a key of dimension elements which is the first in the EAX_ACTION express report sidehead. The number of images should correspond to the number of dimension elements.
For example, the first dimension in the report sidehead contains three elements with the 301, 303 and 305 keys. The file system should contain the following images: C:\Dim_301, C:\Dim_303 and C:\Dim_305.
Add links to the Express, Metabase, Pivot and Tab system assemblies.
Sub UserProc;
Var
mb: IMetabase;
Report: IEaxAnalyzer;
Pivot: IPivot;
PivotDim: IPivotDimension;
HeadSets: IDataAreaHeaderSettingsBase;
Grid: IEaxGrid;
DimSettings: IEaxGridDimensionSettings;
Drill: IEaxDrillSettings;
s: string;
Begin
// Get current repository
mb := MetabaseClass.Active;
// Get express report
Report := mb.ItemById("EAX_ACTION").Edit As IEaxAnalyzer;
// Get object used to create data table
Pivot := Report.Pivot;
// Get the first dimension in the table sidehead
PivotDim := Pivot.LeftHeader.PivotDim(0);
HeadSets := PivotDim As IDataAreaHeaderSettingsBase;
// Get analytical data area table
Grid := Report.Grid;
// Determine that dimension elements are displayed as hyperlinks
Grid.ViewSettings.HyperlinkAsText := False;
// Get settings of the first dimension in table sidehead
DimSettings := Grid.ViewSettings.GetViewSettings(HeadSets) As IEaxGridDimensionSettings;
// Enable detailing for this dimension
If Not DimSettings.IsDrilled Then
DimSettings.Drilled := TriState.OnOption;
End If;
// Get detailing dimensions
Drill := DimSettings.Drill;
// Allocate action executed on clicking the dimension element hyperlink
Drill.Action := "C:\Dim_&[DIMENSION.KEY].png";
Drill.ActionType := TabHyperlinkActionType.OpenFile;
// Determine dimension which is specified in the action
Drill.PrepareAction(PivotDim.DimInstance);
// Parse action for the first dimension element and display it to the console window
s := Drill.ParseAction(1);
Debug.WriteLine(s);
// Save changes in report
(Report As IMetabaseObject).Save;
End Sub UserProc;
After executing the example the action for hyperlinks in table sidehead is allocated: open image corresponding to the dimension element.
See also: