Opens a standard dialog box for batch export of a regular report including options to set additional parameters for dialog box opening.
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:
|
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:
|
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:
|
Element 2: PrxEnableExportFormats | Selected export format. |
Element 3: String | Path to save exported file(s). |
Element 4: Boolean | The checkbox that determines export result:
|
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.
Executing the example requires a form, the Button1 button, the ReportBoxNet component and the UiReportnet component named UiReportNet1, which is used as a data source for the ReportBoxNet component. The UiReportNet1 component is connected to a regular report, for which batch export is available.
Imports Prognoz.Platform.Interop.Dimensions;
Imports Prognoz.Platform.Interop.Report;
Imports Prognoz.Platform.Interop.Ui;
Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
WinApp: WinApplication = New WinApplicationClass_2();
Rep: IPrxReport;
SelSet: IPrxBulkSelectionSet;
Target: IUiCommandTarget;
Context: IUiCommandExecutionContext;
Data: Array;
Res: Object;
Begin
Rep := UiReportNet1.ReportUi.Report;
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 := WinApp.GetPluginTarget("Report");
Context := Target.CreateExecutionContext();
Data := New Object[5];
Data[0] := Rep;
Data[1] := SelSet;
Data[2] := PrxEnableExportFormats.peefAll;
Data[3] := True;
Data[4] := False;
Context.Data := Data;
Res := Target.Execute("ShowBulkExportDialogEx", Context, Null);
End Sub;
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: