ICalculateReportScheduledTask.ReadResult

Syntax

ReadResult(TaskResult: IScheduledTaskResult; [Report: IPrxReport = Null]): IPrxReport;

Parameters

TaskResult. Container task.

Report. The report, to which task calculation result will be loaded.

Description

The ReadResult method gets task calculation result as a report and enables the user to load the result to the specified report.

Comments

This method is used if the format for saving the result of task calculation has not been specified. Format for saving is specified in the ICalculateReportScheduledTask.FormatTag property.

Example

Executing the example requires that the repository contains a scheduled tasks container with the TASK_CONTAINTER identifier. The first task of the container calculates regular report.

Add links to the Fore, Metabase, and Report system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    obj: IMetabaseObject;
    Cont: IScheduledTasksContainer;
    Exe: ICalculateReportScheduledTask;
    Report: IPrxReport;
Begin
    // Get repository
    MB := MetabaseClass.Active;
    // Get task from container
    Cont := MB.ItemById("TASK_CONTAINER").Bind As IScheduledTasksContainer;
    Exe := Cont.Tasks.Item(0).Bind As ICalculateReportScheduledTask;
    // Get result
    Report := Exe.ReadResult(Exe.GetResults.Item(0));
    If Report = Null Then
        Debug.WriteLine("No result.");
        Else
        Debug.WriteLine(Report);
    End If;
End Sub UserProc;

After executing the example the console window displays task execution result.

See also:

ICalculateReportScheduledTask