IPrxReport.Toolbar

Syntax

Toolbar: IPrxToolbar;

Description

The Toolbar property returns toolbar settings in a regular report.

Comments

The toolbar contains system buttons, separators, and custom buttons, and custom groups of buttons.

Example

To execute the example the repository must contain a regular report with the REPORT identifier. The toolbar can be changed in a report.

Add links to the Metabase, Report system assemblies.

Sub UserProc;
Var
    Mb: IMetabase;
    Report: IPrxReport;
    Toolbar: IPrxToolbar;
Begin
    Mb := MetabaseClass.Active;
    // Get regular report
    Report := Mb.ItemById("REPORT").Bind As IPrxReport;
    // Get toolbar
    Toolbar := Report.Toolbar;
    Debug.WriteLine("Changes on the toolbar: " + Toolbar.IsCustom.ToString);
    // View information about elements
    ShowElements(Toolbar.Elements);
End Sub UserProc;

Sub ShowElements(Elements: IPrxToolbarElements);
Var
    Element: IPrxToolbarElement;
Begin
    For Each Element In Elements Do
        Debug.WriteLine(Element.Name + '(' + Element.Id + ')' + ' ' + Element.Type.ToString);
        // If element is a custom group of buttons, view recursively information about group buttons
        If Element.Type = PrxToolbarElementType.UserGroup Then
            Debug.Indent;
            ShowElements((Element As IPrxUserGroupElement).Elements);
            Debug.Unindent;
        End If;
    End For;
End Sub ShowElements;

After executing the example the development environment console displays information about toolbar elements of the specified report.

See also:

IPrxReport