Opens a standard dialog box for batch export of an express report.
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: IEaxAnalyzer | Express report. |
Element 2: EaxEnabledExportFormats | The element that is used to limit export formats in the dialog box. To set several formats, use Or. |
Element 3: Boolean | The checkbox that is used to hide the button of exporter parameter settings. If the parameter is set to False, the Parameters button is hidden, and by default, charts are exported according to the settings of the last export. If the parameter is set to True, the Parameters button is shown. |
Element 4: Boolean | The checkbox that is used to hide selection of the export result, that is, creating one or several files. If the parameter is set to False, the Result radio button is hidden, and by default, several files are created. If the parameter is set to True, the Result radio button is shown and available to select. |
Element 5: Boolean | The checkbox that enables system export. If the parameter is set to False, the export on closing the wizard must be executed in application code according to the settings returned by the Execute method. |
Element 6: Boolean | The checkbox that enables the warnings that export conditions are not fulfilled in the report. If the parameter is set to True, export of the report with unfulfilled conditions is followed by the warning that export will be stopped, and the Execute method will return the export result, which is False. If the parameter is set to False, export of the report with unfulfilled conditions, export is stopped without warnings, and the Execute method returns the export result, which is False. |
The Execute method in the correct express report will return the array of the Variant type containing the following elements:
Export result:
True. Successful. If export is successful.
False. If export is unsuccessful. If the user canceled export or the report does not satisfy export conditions.
Export format specified in the dialog box.
Folder path (only for export to several files). On export to one or several (1) files returns empty value.
Indicates whether several files are created on export:
True. Yes, the report was exported to several files.
False. No, the report was exported to a single file.
Executing the example requires a form and a button named Button1 on the form. The repository contains an express report with the EXPRESS_REPORT identifier.
Add links to the Express, Metabase and Ui system assemblies.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var Target: IUiCommandTarget;
Context: IUiCommandExecutionContext;
Data: Array;
Result: Array;
m_Analyzer : IEaxAnalyzer;
Begin
m_Analyzer := MetabaseClass.Active.ItemById("EXPRESS_REPORT").Bind As IEaxAnalyzer;
Target := WinApplication.Instance.GetPluginTarget("Express");
Context := Target.CreateExecutionContext;
Data := New Variant[6];
Data[0] := m_Analyzer;
Data[1] := EaxEnabledExportFormats.All Or EaxEnabledExportFormats.PDF;
Data[2] := True;
Data[3] := True;
Data[4] := True;
Data[5] := True;
Context.Data := Data;
Result := Target.Execute("ShowBulkExportDialog", Context) As Array;
debug.WriteLine("Export result: " + (Result[0] As Boolean).ToString);
If Result.Length > 1 Then
debug.WriteLine("Export format: " + (Result[1] As EaxEnabledExportFormats).ToString);
debug.WriteLine("Path: " + (Result[2] As String));
debug.WriteLine("Export to several files: " + (Result[3] As Boolean).ToString);
End If;
End Sub Button1OnClick;
After executing the example the express report is exported by the defined parameters, the console window displays export result and format, path to the folder.
See also: