TargetType: TabFormatNumericScaleTargetType;
The TargetType property determines application area of the numeric scale.
To determine area of color scale, use ITabFormatScale.TargetType.
Executing the example requires that the repository contains a regular report with the REG_SCALE identifier. For cells of the A0:K25 range any values must be set. In the example there is the DAdap class implementing data source for cell conditional format.
Add links to the Metabase, Report, Tab system assemblies.
// Implement data source
Class DAdap: Object, ITabFormatDataAdapter
Public Function get_Data(Row: integer; Column: integer): Variant;
Begin
Return Row * Column;
End Function get_Data;
End Class DAdap;
Sub UserProc;
Var
MB: IMetabase;
RegRep: IPrxReport;
Tab: IPrxTable;
Sheet: ITabSheet;
Range: ITabRange;
FormCond: ITabFormatCondition;
Scale: ITabFormatNumericScale;
Begin
// Get repository
MB := MetabaseClass.Active;
// Get regular report
RegRep := MB.ItemById("REG_SCALE").Edit As IPrxReport;
// Get active report sheet
Tab := RegRep.ActiveSheet As IPrxTable;
// Get report sheet table
Sheet := Tab.TabSheet;
// Get cell range
Range := Sheet.ParseRange("A0:K25");
// Add new conditional format in collection
FormCond := Range.FormatConditions.Add;
// Add data source
FormCond.DataAdapter := New DAdap.Create;
// Set type of conditional format - numeric scale
FormCond.Type := TabConditionType.NumericScale;
// Get specific settings of conditional format
Scale := FormCond.Details As ITabFormatNumericScale;
// Use automatic values
Scale.UseAutoValues := True;
// Start value for font size
Scale.StartValue := 7;
// End value for font size
Scale.EndValue := 20;
// Numeric scale will be used for font size
Scale.TargetType := TabFormatNumericScaleTargetType.FontSize;
// Save changes
(Regrep As IMetabaseObject).Save;
End Sub UserProc;
After executing the example, cell value size for the A0:K25 range changes according to specified parameters.
See also: