Period: IDimCalendarPeriodSelection;
The Period property returns parameters of calendar element selection.
Using this property one can select calendar dictionary elements at specified time range and at selected levels.
Executing the example requires a form, a button named Button1 positioned on this form, and the DimensionTree component which uses the UiDimension component named UiDimension1 as the data source. UiDimension provides access to calendar dictionary.
This example is executed on clicking the button.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
DimSelection: IDimCalendarSelection;
CalendarPeriod: IDimCalendarPeriodSelection;
StartDate, EndDate: DateTime;
Begin
UiDimension1.Active := True;
DimSelection := UiDimension1.Selection As IDimCalendarSelection;
CalendarPeriod := DimSelection.Period;
CalendarPeriod.Levels := DimCalendarLevelSet.Quarter;
CalendarPeriod.Select_(DimCalendarLevelSet.HalfYear, False);
StartDate := DateTime.Parse("10.08.2001");
If StartDate < CalendarPeriod.Start Then
StartDate := CalendarPeriod.Start;
End If;
EndDate := DateTime.Parse("10.10.2002");
If EndDate > CalendarPeriod.End_ Then
EndDate := CalendarPeriod.End_;
End If;
CalendarPeriod.Set_(StartDate, EndDate);
CalendarPeriod.Active := True;
UiDimension1.Selection := DimSelection As IDimSelection;
End Sub Button1OnClick;
After executing the example quarters and half-year levels are selected in calendar dictionary at the period from 10.08.2001 to 10.10.2002.
See also: