UseValidationFilterDates: ValidationFilterDataOptions;
The UseValidationFilterDates property determines how to register calculation dates set for validation.
Use the IValidationFilter.StartDateSettings and IValidationFilter.EndDateSettings properties to determine dates of validation calculation.
By default validation is applied only in the calculation period, that is, UseValidationFilterDates = ValidationFilterDataOptions.PeriodByValidation.
Executing the example requires a form, containing the LanerBox component with the LanerBox1 identifier and the UiErAnalayzer component with the UiErAnalyzer1 identifier. UiErAnalyzer1 is a data source for LanerBox1 and contains a loaded express report. The repository should contain a time series database with the TSDB identifier containing a validation calculation rule of the Comparison with Expression type with the VALIDATION identifier.
Add links to the Metabase, Ms system assemblies.
Sub UserProc;
Var
Express: IEaxAnalyzer;
DiagRpt: IDiagnosticReport;
Slice: IEaxDataAreaSlice;
mb: IMetabase;
ValFilter: IValidationFilter;
ValCustom: IValidationCustom;
Out: IMsDatePeriod;
Begin
// Get express report
Express := UiErAnalyzer1.ErAnalyzer;
// Create a diagnostic report
DiagRpt := Express.Grid.DiagnosticReport;
If DiagRpt = Null Then
DiagRpt := New DiagnosticReport.Create;
Express.Grid.DiagnosticReport := DiagRpt;
End If;
// Set express report calculation dates
Slice := Express.DataArea.Slices.Item(0);
Slice.ExtendedPeriodStart := DateTime.Parse("01.01.1990");
Slice.ExtendedPeriodEnd := DateTime.Parse("01.01.2007");
Slice.UseExtendedPeriod := True;
// Get custom validation
mb := MetabaseClass.Active;
ValFilter := mb.ItemByIdNamespace("VALIDATION", mb.GetObjectKeyById("TSDB")).Edit As IValidationFilter;
// Set validation parameters
ValCustom := ValFilter.Details As IValidationCustom;
// Set validation calculation parameters
Out := ValCustom.Transform.OutputPeriod As IMsDatePeriod;
Out.AutoPeriod := MsAutoPeriodOptions.AllByOwner;
Out.Start := DateTime.Parse("01.01.1993");
Out.End_ := DateTime.Parse("01.01.2007");
ValCustom.UseValidationFilterDates := ValidationFilterDataOptions.PeriodByValidation;
// Save changes in validation
ValFilter.MetabaseObject.Save;
// Apply validation for express report
Slice.Validations.Add(ValFilter);
Express.Grid.Refresh;
End Sub UserProc;
Example execution result: validation rule is applied for the express report loaded into UiErAnalyzer in the calculation period.
See also: