IValidationFilterSettings.CellStyle

Syntax

CellStyle: ILanerCellStyle;

Description

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

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.

See also:

IValidationFilterSettings