IDimCalendarPeriodSelection.FindOutActive

Syntax

FindOutActive;

Description

The FindOutActive method sets up period parameters based on the current selection.

Comments

If the first selected element in the dictionary is 01.01.1990, and the last selected element is 01.01.1992, all months are selected between these elements, and there are no other selected elements, after calling the FindOutActive method the following properties are set: Start - 01.01.1990 00:00:00, End_ - 01.01.1992 00:00:00, Levels - number of months between them, Active = True.

Example

Executing the example requires a form containing the Button component with the Button1 identifier, the DimensionTree component with DimensionTree1 identifier and the UiDimension component with the UiDimension1 identifier. Specify the data source UiDimension1 for the DimensionTree1 component. A calendar dictionary is used as a data source. The example is a handler of the OnClick event for the Button1 component.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    CalendarSel: IDimCalendarSelection;
    SelPeriod: IDimCalendarPeriodSelection;
Begin
    CalendarSel := UiDimension1.Selection As IDimCalendarSelection;
    SelPeriod := CalendarSel.Period;
    SelPeriod.FindOutActive;
    Debug.WriteLine(SelPeriod.Start.ToString + " " + SelPeriod.End_.ToString);
    Debug.WriteLine(SelPeriod.Levels);
    Debug.WriteLine(SelPeriod.Active);
End Sub Button1OnClick;

On clicking the Button1 button the console window shows period parameters based on the current selection.

See also:

IDimCalendarPeriodSelection