ShowBulkExportDialogEx Command

Purpose

Opens a standard dialog box for batch export of a regular report including options to set additional parameters for dialog box opening.

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: IPrxReport The regular report, for which batch export dialog box opens.
Element 2: IPrxBulkSelectionSet The selection of dimensions allowed to be used in batch export. The specified selection is set for dimensions on the first page of the dialog box. It can be changed later.
Element 3: PrxEnableExportFormats The list of export formats, which can be selected in the dialog box.
Element 4: Boolean The checkbox, which determines whether the button that is used to select additional export formats is available in the dialog box. Available values of the checkbox:
  • True. The button is shown.
  • False. The button is not shown.
Element 5: Boolean The checkbox, which determines whether the user can select whether to export data to one or to several files. Available values of the checkbox:
  • True. Checkboxes to select export results are shown.
  • False. Checkboxes to select export results are not shown.

Application Features

The command can be used only for regular reports. After appropriate parameters are selected and the Finish button is clicked, the export is not executed. Executing the command results in the array that contains the following elements:

Value type Description
Element 1: Boolean Result of closing the dialog box:
  • True. The Finish button is clicked in the dialog box.
  • False. The Cancel button is clicked in the dialog box. In this case the array will no longer contain elements.
Element 2: PrxEnableExportFormats Selected export format.
Element 3: String Path to save exported file(s).
Element 4: Boolean The checkbox that determines export result:
  • True. Export to several files.
  • False. Export to one file.

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. The UiReport1 component is connected to a regular report, for which batch export is available.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    Rep: IPrxReport;
    SelSet: IPrxBulkSelectionSet;
    Target: IUiCommandTarget;
    Context: IUiCommandExecutionContext;
    Data: Array;
    Res: Variant;
Begin
    Rep := UiReport1.Instance As IPrxReport;
    SelSet := Rep.GetBulkSelectionSet("1,2");
    //Selection of all elements in the first dimension
    //This selection is displayed for dimension in the dialog
    SelSet.Item(0).Selection.SelectAll;
    Target := WinApplication.Instance.GetPluginTarget("Report");
    Context := Target.CreateExecutionContext;
    Data := New Variant[5];
    Data[0] := Rep;
    Data[1] := SelSet;
    Data[2] := PrxEnableExportFormats.All;
    Data[3] := True;
    Data[4] := False;
    Context.Data := Data;
    Res := Target.Execute("ShowBulkExportDialogEx", Context);
End Sub Button1OnClick;

Clicking the button opens a dialog box for batch export of report. All elements in the first dimension are selected in the dialog box, any of the available export formats and its additional parameters can be selected and set up. Settings results are available after clicking the Finish button as an array contained in the Res variable.

See also:

IUiCommandTarget.Execute