Mode: EaxDataDrillMode;
Mode: Prognoz.Platform.Interop.Express.EaxDataDrillMode;
The Mode property determines selection modification mode in dimension elements detailing.
By default the property is set to EaxDataDrillMode.None.
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 analytical data area. The report contains one sheet.
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 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);
// Update report and save changes
Rep.Recalc;
(Rep As IMetabaseObject).Save;
End Sub UserProc;
After executing the example:
For specified regular report dimension elements detailing will be used.
On clicking the dimension element, you will be directed by specified hyperlink.
The console displays dimension and data slice keys.
The requirements and result of the Fore.NET Example execution match with those in the Fore Example.
Imports Prognoz.Platform.Interop.Dimensions;
Imports Prognoz.Platform.Interop.Express;
Imports Prognoz.Platform.Interop.ForeSystem;
Imports Prognoz.Platform.Interop.Pivot;
Imports Prognoz.Platform.Interop.Report;
Imports Prognoz.Platform.Interop.Tab;
…
Public Shared Sub Main(Params: StartParams);
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 := Params.Metabase;
// Get regular report
Rep := MB.ItemById["REG_MOVE"].Edit() As IPrxReport;
// Get data slice as 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.tsOnOption;
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.eddmReplace;
// 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.thatOpenURL;
Drill.Action := "www.example.com";
Drill.Target := TabHyperlinkTarget.thtTop;
// Display to the console data slice key and dimension key
System.Diagnostics.Debug.WriteLine("Data slice key = " + Drill.SliceKey.ToString());
System.Diagnostics.Debug.WriteLine("Dimension key = " + Drill.DimensionKey.ToString());
// Update report and save changes
Rep.Recalc();
(Rep As IMetabaseObject).Save();
End Sub;
See also: