UseValidationFilterDates: ValidationFilterDataOptions;
UseValidationFilterDates: Prognoz.Platform.Interop.Ms.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.
The requirements and result of the Fore.NET example execution match with those in the Fore example. Use Fore.NET analogs instead of Fore components.
Imports Prognoz.Platform.Interop.Express;
Imports Prognoz.Platform.Interop.Ms;
Sub UserProc();
Var
Express: IEaxAnalyzer;
DiagRpt: DiagnosticReport;
Slice: IEaxDataAreaSlice;
mb: IMetabase;
ValFilter: IValidationFilter;
ValCustom: IValidationCustom;
Outp: IMsDatePeriod;
Begin
// Get express report
Express := uiErAnalyzerNet1.ErAnalyzer.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 := Self.Metabase;
ValFilter := mb.ItemByIdNamespace["VALIDATION", mb.GetObjectKeyById("TSDB")].Edit() As IValidationFilter;
// Set validation parameters
ValCustom := ValFilter.Details As IValidationCustom;
// Set validation calculation parameters
Outp := ValCustom.Transform.OutputPeriod As IMsDatePeriod;
Outp.AutoPeriod := MsAutoPeriodOptions.msapoAllByOwner As integer;
Outp.Start := DateTime.Parse("01.01.1993");
Outp.@End := DateTime.Parse("01.01.2007");
ValCustom.UseValidationFilterDates := ValidationFilterDataOptions.vfdoPeriodByValidation;
// Save changes in validation
ValFilter.MetabaseObject.Save();
// Apply validation for express report
Slice.Validations.Add(ValFilter);
Express.Grid.Refresh();
End Sub UserProc;
See also: