Show contents 

Express > Express Assembly Interfaces > IExAnalyzerExporter > IExAnalyzerExporter.StartBatchCommand

IExAnalyzerExporter.StartBatchCommand

Syntax

StartBatchCommand(FileName: String; FormatTag: String);

Parameters

FileName. Name of the file, to which export will be executed.

FormatTag. The format of the file for export. Export is available to the following formats: mht, html, pdf, xls, rtf, emf.

Description

The StartBatchCommand method starts batch data export to a file of the specified format.

Comments

After calling this method, each time the  IExporter.ExportToFile  method is called, the report specified in the IExAnalyzerExporter.ExAnalyzer property is exported. Export is performed to the file with parameters set for the StartBatchCommand method. To finish batch data export, call the IExAnalyzerExporter.FinishBatchCommand method. Thus, several reports may be exported to a single file.

Example

Executing the example requires a form with the Button1 button, the MetabaseOpenDialog component named MetabaseOpenDialog1 and the Memo component named Memo1.

The example is executed on clicking the Button1 button.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    Filter: IMetabaseDialogClassFilter;
    Objects: IMetabaseObjectDescriptorList;
    List: IStringList;
    Exp: ExAnalyzerExporter;
    i: integer;
    id: String;
    Count: Integer;
Begin
    MetabaseOpenDialog1.MultiSelect := 
True;
    
// Create a filter for repository object opening dialog box
    Filter := New MetabaseDialogClassFilter.Create;
    Filter.Description := 
"Express reports";
    //Select type of objects to be displayed in the dialog box
    // on using this filter: express report
    Filter.ObjectClass := MetabaseObjectClass.KE_CLASS_EXPRESSREPORT;
    MetabaseOpenDialog1.Filters.AddFilter(Filter);
    
If MetabaseOpenDialog1.Execute(Self) Then
        
// These operations are executed if the user selected one or more express reports
        Objects := MetabaseOpenDialog1.Objects;
        Count := Objects.Count;
        List := Memo1.Lines;
        List.Add(
"Number of  reports to  be exported:" + Count.ToString);
        
// Start of batch export of selected reports
        Exp := New ExAnalyzerExporter.Create;
        Exp.StartBatchCommand(
"C:\BatchFileExp.xls""XLS");
        
For i := 0 To Count - 1 Do
            id := Objects.Item(i).Id;
            Exp.ExAnalyzer := MetabaseClass.Active.ItemById(id).Bind 
As IEaxAnalyzer;
            Exp.ExportToFile(
"""XLS");
            List.Add(
"Report '" + Objects.Item(i).Name + "' Exported");
        
End For;
        
// End of batch export of selected reports
        Exp.FinishBatchCommand;
        List.Add(
"Report  export  complete");
    
End If;
End Sub Button1OnClick;

The dialog box of repository object opens when executing the example. In this dialog box, select the express reports to be exported. After the objects are selected, they are exported to the C:\BatchFileExp.xls file. Messages on export progress are displayed in the Memo1 component.

See also:

IExAnalyzerExporter