Period: IDimCalendarPeriodSelection;
The property is read-only.
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.
Executing the example requires a .NET form, a button named Button1 positioned on this form, and the DimensionTreeNet component which uses the UiDimensionNet component named UiDimensionNet1 as the data source. UiDimensionNet provides access to calendar dictionary.
This example is executed on clicking the button.
Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
DimSelection: IDimCalendarSelection;
CalendarPeriod: IDimCalendarPeriodSelection;
StartDate, EndDate: DateTime;
Begin
UiDimensionNet1.Active := True;
DimSelection := UiDimensionNet1.Selection As IDimCalendarSelection;
CalendarPeriod := DimSelection.Period;
CalendarPeriod.Levels := DimCalendarLevelSet.dclsQuarter;
CalendarPeriod.@Select(DimCalendarLevelSet.dclsHalfYear, 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;
UiDimensionNet1.Selection := DimSelection As IDimSelection;
End Sub;
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: