Drill: IDefDrillDimension;
The Drill property returns drill down settings for a dimension.
Executing the example requires two data entry forms with the DEF_ANALYTICS and DEF_DRILL identifiers. The DEF_ANALYTICS data entry form contains a table data area, the data area sidehead contains a dimension based on a dictionary with the COMPANY identifier. The DEF_DRILL data entry form contains a parameter that is also based on the COMPANY dictionary.
Add links to the Dimensions and Metabase system assemblies. Add links to the assemblies required for working with data entry forms.
Sub UserProc;
Var
Mb: IMetabase;
DEF: IDataEntryForm;
TArea: IDefTableArea;
Dim: IDefDimension;
Drill: IDefDrillDimension;
DrillParam: IDefDrillDimensionParameterValue;
Begin
Mb := MetabaseClass.Active;
// Data entry/output form
DEF := New DataEntryForm.CreateByDataEntryForm(Mb.ItemById("DEF_ANALYTICS"), True);
// Get dimension
TArea := DEF.InputAreas.Item(0) As IDefTableArea;
Dim := TArea.DefDimensions.ItemByKey(Mb.GetObjectKeyById("COMPANY"));
// Set up drill down
Drill := Dim.Drill;
Drill.DrillDescriptor := Mb.ItemById("DEF_DRILL");
Drill.CreateElement := True;
Drill.RefreshAfterCreationClose := True;
Drill.OpenOnSheetKey := 1;
Drill.UserCaption := "Details";
// Manage parameter
DrillParam := Drill.ParameterValues.Item(0);
DrillParam.DrillType := emDrillType.attr;
DrillParam.Value := (Mb.Item(Dim.Key).Bind As IDimensionModel).Attributes.Id.Id;
// Apply changes
DEF.InputAreas.ApplyAreaToReport(TArea.Id);
// Save changes
DEF.Save;
DEF._Dispose;
End Sub UserProc;
After executing the example, drill down will be set up for the specified table area dimension. General drill down settings will be determined, and management of parameter of opened object will be set up. Clicking any dimension element will open the DEF_DRILL data entry form; the key of the element, for which drill down opens, will be sent as a form parameter value.
See also: