TableStyleSetup Command

Purpose

Creates a new table style and opens a standard style setup dialog box.

Parameters of Use

Command parameters are passed in the Data property. Executing the command requires to specify an array of the Variant type in this property, the elements of this array contain the following values:

Value type Description
Element 1:  ITabSheet The page containing a cell range.
Element 2: ITabRange The cell range, for which the table style setup dialog box opens. If this parameter is not specified, and a single cell is selected in the table, the dialog box opens that is used to set up styles of the entire table. If a cell range is selected in the table, the dialog box opens to set up styles for this range.
Element 3: IStyleSheet Optional parameter defining a set of styles, which styles are to be available when setting up formatting. The following objects can be used as values for this parameter: sets of repository style tables, or a style set selected for the repository in the StyleSheet property.

NOTE. If a style set is selected for the regular report, but this set is not specified in the element 2 of the array, the styles of this style set are unavailable on formatting setup.

Application Features

The command is used only for regular reports.

Example

Executing the example requires a form with the Button1 button, the ReportBox component and the UiReport component named UiReport1, which is used as a data source for the ReportBox component. UiReport1 is connected to a regular report.

    Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
    Var
        Rep: IPrxReport;
        Sheet: ITabSheet;
        Target: IUiCommandTarget;
        Context: IUiCommandExecutionContext;
        Data: Array;
    Begin
        Rep := UiReport1.Instance As IPrxReport;
        Sheet := Rep.ActiveSheet As ITabSheet;
        Target := WinApplication.Instance.GetPluginTarget("Report");
        Context := Target.CreateExecutionContext;
        Data := New Variant[3];
        Data[0] := Sheet;
        Data[1] := Sheet.ParseRange("A0:C10");
        If Rep.StyleSheet <> Null Then
            Data[2] := Rep.StyleSheet;
        End If;
        Context.Data := Data;
        Target.Execute("TableStyleSetup", Context);
    End Sub Button1OnClick;

Clicking the button for the A0:C10 table range creates a new table style and displays a dialog box that is used to set up its parameters. If a repository style set is linked to the regular report, styles of this set are available on setting up the newly created style.

See also:

IUiCommandTarget.Execute