IPPSpeedometerBorders.Add

Fore Syntax

Add(Value: IPPSpeedometerBorder): Integer;

Fore.NET Syntax

Add(Value: Prognoz.Platform.Interop.Speedometer.PPSpeedometerBorder): integer;

Parameters

Value. Added border.

Description

The Add method adds a border to the collection.

Fore Example

Executing the example requires that the repository contains a database with the ADHOC identifier. A dashboard must contain a speedometer.

Add links to the Adhoc, Express, Metabase, Speedometer system assemblies.

Sub UserProc;
Var
    Speedometer: IPPSpeedometer;
    MB: IMetabase;
    AdhocReport: IAdhocReport;
    EaxSpeedometer: IEaxSpeedometer;
    Enalyzer: IEaxAnalyzer;
    DsObjs: IAdhocDataSourceObjects;
    Borders: IPPSpeedometerBorders;
    Border: IPPSpeedometerBorder;
Begin
    MB := MetabaseClass.Active;
    // Get dashboard 
    AdhocReport := MB.ItemById("ADHOC").Edit As IAdhocReport;
    // Get dashboard data sources
    DsObjs := AdhocReport.DataSourceObjects;
    // Get speedometer
    Enalyzer := DsObjs.Item(0).GetSourceObject As IEaxAnalyzer;
    EaxSpeedometer := Enalyzer.Speedometer;
    // Get speedometer parameters
    Speedometer := EaxSpeedometer.Speedometer;
    Speedometer.EnableBorder := True;
    // Get collection of speedometer borders
    Borders := Speedometer.Borders;
    // Display size of borders collection
    Debug.WriteLine("Borders before removal: " + Borders.Count.ToString);
    // Remove all old borders
    Borders.RemoveAll;
    // Add a border with set width
    Borders.Add(Borders.CreateBorder(10));
    (Enalyzer As IMetabaseObject).Save;
End Sub UserProc;

After executing the example the console window displays size of collection of borders. The collection is cleared, after which a new border is created and added to the collection.

Fore.NET Example

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

Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.AdHoc;
Imports Prognoz.Platform.Interop.Express;
Imports Prognoz.Platform.Interop.Speedometer;

Public Shared Sub Main(Params: StartParams);
Var
    Speedometer: IPPSpeedometer;
    MB: IMetabase;
    AdhocReport: IAdhocReport;
    EaxSpeedometer: IEaxSpeedometer;
    Enalyzer: IEaxAnalyzer;
    DsObjs: IAdhocDataSourceObjects;
    Borders: IPPSpeedometerBorders;
    Border: IPPSpeedometerBorder;
Begin
    MB := Params.Metabase;
    // Get dashboard 
    AdhocReport := MB.ItemById["ADHOC"].Edit() As IAdhocReport;
    // Get dashboard data sources
    DsObjs := AdhocReport.DataSourceObjects;
    // Get speedometer
    Enalyzer := DsObjs.Item[0].GetSourceObject() As IEaxAnalyzer;
    EaxSpeedometer := Enalyzer.Speedometer;
    // Get speedometer parameters
    Speedometer := EaxSpeedometer.Speedometer;
    // Get collection of speedometer borders
    Borders := Speedometer.Borders;
    // Display size of borders collection
    System.Diagnostics.Debug.WriteLine("Borders before removal: " + Borders.Count.ToString());
    // Remove all old borders
    Borders.RemoveAll();
    // Add a border with set width
    Borders.Add(Borders.CreateBorder(10));
    (Enalyzer As IMetabaseObject).Save();
End Sub;

See also:

IPPSpeedometerBorders

Related work items

Requirement