SheetProtection Command

Purpose

Opens a standard dialog box that is used to protect a sheet.

Parameters of Use

Command parameters are passed in the Data property. To ensure command execution, specify one of the following values in this property:

Value type Description
IPrxSheet The regular report sheet, for which it is required to show the dialog box that is used to protect a sheet.

Application Features

The command can be used only for regular reports. Executing the command shows logical True if the OK button is clicked in the dialog box, and False if the Cancel button is clicked.

Example

Executing the example requires a form, the Button1 button on the form, the ReportBox component and the UiReport component named UiReport1, which is used as a data source for the ReportBox component.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    Report: IPrxReport;
    Target: IUiCommandTarget;
    Context: IUiCommandExecutionContext;
Begin
    Report := UiReport1.Instance As IPrxReport;
    Target := WinApplication.Instance.GetPluginTarget("Report");
    Context := Target.CreateExecutionContext;
    Context.Data := Report.ActiveSheet;
    Target.Execute("SheetProtection", Context);
End Sub Button1OnClick;

Clicking the button opens a dialog box that is used to set up protection of regular report active sheet.

See also:

IUiCommandTarget.Execute