NumberFormatter: IVZNumberFormatter;
The NumberFormatter property determines a format of visualizer numeric data.
Executing the example requires that the repository contains an express report with the EXPRESS identifier that contains a bubble tree.
Add links to the Express, Metabase, Visualizators system assemblies.
Sub UserProc;
Var
Metabase: IMetabase;
Analyzer: IEaxAnalyzer;
BubbleTree: IVZBubbleTree;
Formatter: IVZBaseFormatter;
Format, OutStr: String;
Params: IVZDataArray;
Value: Double;
FormatNum: IVZNumberFormatter;
Begin
// Get repository
Metabase := MetabaseClass.Active;
// Get express report
Analyzer := Metabase.ItemById("EXPRESS").Edit As IEaxAnalyzer;
// Get bubble tree
BubbleTree := Analyzer.BubbleTree.BubbleTree;
{ Get region name by its identifier and
value by color scale }
Formatter := BubbleTree.Formatter;
Format := Formatter.FormatById("Region: {%Name}, " +
"element value by color scale: {%ColorValue}", "17", "no data");
Debug.WriteLine(Format);
// Get percentage expression of the number 0.42535
Value := 0.42535;
FormatNum := Formatter.NumberFormatter;
FormatNum.ConvertInvariant2LocalNumberFormat("0.00%");
FormatNum.LocalFormatObject(Value, "0.00%", OutStr);
Debug.WriteLine("The number 0.42535 expressed as percentage: " + OutStr);
{ Get exponential format of the number 2011 and
format of the number 15258.2 with two decimal places }
Format := Formatter.FormatByParams("Exponential format of the number 2011: " +
"{0:0E+0}, record with two decimal places: {1}", 2011, 15258.2, "0.00");
Debug.WriteLine(Format);
// Get records of two phone numbers in user-friendly format
Params := New VZDataArray.Create;
Params.Add(89209242536);
Params.Add(84922444090);
Format := Formatter.Format("Contact phones: {0}; {1:#(####)##-##-##}", Params, "#-###-###-##-##");
Debug.WriteLine(Format);
End Sub UserProc;
After executing the example, the development environment console displays:
Region name with the 17 identifier and it value by color scale.
Percentage expression of the 0.42535 number, the number 2011 in exponential format of record and the number 15258.2 in the format of record with two decimal places.
Two phone numbers in user-friendly format.
See also: