IValidationFilterSettings.CellStyle

Fore Syntax

CellStyle: ILanerCellStyle;

Fore.NET Syntax

CellStyle: Prognoz.Platform.Interop.Laner.LanerCellStyle;

Description

The CellStyle property returns formatting style for cells with validation exceptions.

Fore Example

Executing the example requires that the repository contains a time series database with the TSDB identifier containing a validation filter with the NAMBCOMP_VALIDATION identifier.

Add links to the Drawing, Laner, Metabase, Ms, Tab system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    Rubricator: IMetabaseObjectDescriptor;
    valObj: IMetabaseObject;
    valid: IValidationFilter;
    Settings: IValidationFilterSettings;
    Style: ILanerCellStyle;
    TabStyle: ITabCellStyle;
Begin
    
// Get repository
    MB := MetabaseClass.Active;
    
// Get time series database
    Rubricator := MB.ItemById("TSDB");
    
// Obtain validation rule
    valObj := mb.ItemByIdNamespace("NAMBCOMP_VALIDATION", Rubricator.Key).Edit;
    valid := valObj 
As IValidationFilter;
    
// Change rule description and name
    valid.Description := "Change formatting of validation exceptions";
    valid.MetabaseObject.Name := 
"Changed validation rule";
    
// Get validation settings
    Settings := valid.Settings;
    
// Change importance level for filter
    Settings.Severity := ValidationSeverity.High;
    
// Get formatting style of validation exceptions
    Style := Settings.CellStyle;
    TabStyle := Style.TabStyle;
    
// Change font color for purple
    TabStyle.Font.Color := New GxColor.CreateRGB(16272163);
    
// Change cell background color for pink
    TabStyle.BackgroundBrush := New GxSolidBrush.Create(New GxColor.CreateRGB(250195197));
    
// Change font for "Arial"
    TabStyle.Font.Name := "Arial";
    valObj.Save;
End Sub UserProc;

After executing this example, settings of a validation filter are changed. After applying of the filter cells with validation exceptions have the pink background and purple font.

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore example.

Imports Prognoz.Platform.Interop.Drawing;
Imports Prognoz.Platform.Interop.Laner;
Imports Prognoz.Platform.Interop.Ms;
Imports Prognoz.Platform.Interop.Tab;

Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    Rubricator: IMetabaseObjectDescriptor;
    valObj: IMetabaseObject;
    valid: IValidationFilter;
    Settings: IValidationFilterSettings;
    Style: ILanerCellStyle;
    TabStyle: ITabCellStyle;
    GxColor: GxColorClass_2 = New GxColorClass_2.Create();
    GxSolidBrush: GxSolidBrushClass = New GxSolidBrushClass.Create();
Begin
    // Get repository
    MB := Params.Metabase;
    // Get time series database
    Rubricator := MB.ItemById["TSDB"];
    // Get a validation rule
    valObj := mb.ItemByIdNamespace["NAMBCOMP_VALIDATION", Rubricator.Key].Edit();
    valid := valObj As IValidationFilter;
    // Change rule description and name
    valid.Description := "Change formatting of validation exceptions";
    valid.MetabaseObject.Name := "Changed validation rule";
    // Get validation settings
    Settings := valid.Settings;
    // Change importance level of filter
    Settings.Severity := ValidationSeverity.vsHigh;
    // Get formatting style of validation exceptions
    Style := Settings.CellStyle;
    TabStyle := Style.TabStyle;
    // Change font color for purple
    GxColor.CreateRGB(16272163);
    TabStyle.Font.Color := GxColor;
    // Change cell background color for pink
    GxColor.CreateRGB(250195197);
    GxSolidBrush.Create(GxColor);
    TabStyle.BackgroundBrush := GxSolidBrush;
    // Changing font for Arial
    TabStyle.Font.Name := "Arial";
    valObj.Save();
End Sub;

See also:

IValidationFilterSettings