AppendAttachment: Boolean;
The AppendAttachment property determines whether it is necessary to attach the task execution result to the notification about the task execution completion sent by email.
Sub UserProc;
Var
prop: IScheduledTaskProperties;
period: IScheduledTaskPeriodOneTimeOnly;
CrInfo: IMetabaseObjectCreateInfo;
MObj: IMetabaseObject;
ex: ICalculateReportScheduledTask;
exporter: IPrxReportExporter;
report: IPrxReport;
Begin
report := MB.ItemById("OBJ29714").Bind As IPrxReport;
CrInfo := MB.CreateCreateInfo;
CrInfo.ClassID := MetabaseObjectClass.KE_CLASS_TASK_CALCULATEREPORT;
CrInfo.Id := "Report_calculator1";
CrInfo.Name := "Calculation task of the report 1";
CrInfo.Parent := MB.ItemById("OBJ29709");
MObj := MB.CreateObject(CrInfo).Edit;
Ex := MObj As ICalculateReportScheduledTask;
ex.SourceReport := report;
ex.FormatTag := "xls";
prop := Ex.Properties;
prop.AppendAttachment:=False;
period := (prop.CreatePeriod(ScheduledTaskPeriodType.OneTimeOnly) As IScheduledTaskPeriodOneTimeOnly);
period.StartMode := TaskPeriodOneTimeStartMode.Immediate;
prop.Period := period;
prop.MailAddress:= "test@mail.com";
Exporter := New PrxReportExporter.Create;
exporter.Report := report;
exporter.ExportChartsAsImages := True;
ex.PutExportSettings(exporter);
Mobj.Save;
End Sub UserProc;
After executing the example a regular report calculation task named Report Calculation Task 1 is created, and export parameter settings are saved to this task. The result of the task execution will not be attached to the notification about the task execution completion.
See also: