Editing Task Baseline Durations

Task Baseline Duration

The Duration and EstimatedDuration properties of the TaskBaseLine class can be used to read and write the scheduled duration when the baseline was saved and determine whether the scheduled duration was estimated or not respectively.

After saving a baseline, the task baseline duration can be viewed in Microsoft Project:

  1. On the View menu, select More Views and ten Task Entry.
  2. From the Insert menu, select Columns.
  3. Add the Baseline Duration column.

Getting Task Baseline Duration using Aspose.Tasks

The code example given below demonstrates the task baseline duration in the console window after traversing the task baselines of a task.

 1// Create project instance
 2System::SharedPtr<Project> project = System::MakeObject<Project>();
 3    
 4// Creating TaskBaseline
 5System::SharedPtr<Task> task = project->get_RootTask()->get_Children()->Add(u"Task");
 6project->SetBaseline(Aspose::Tasks::BaselineType::Baseline);
 7    
 8// Display task baseline duration
 9System::SharedPtr<TaskBaseline> baseline = task->get_Baselines()->ToList()->idx_get(0);
10System::Console::WriteLine(u"Baseline duration is 1 day: {0}", System::ObjectExt::Box<bool>(System::ObjectExt::Equals(System::ObjectExt::ToString(baseline->get_Duration()), u"1 day")));
11System::Console::WriteLine(u"BaselineStart is same as Task Start: {0}", System::ObjectExt::Box<bool>(System::ObjectExt::Equals(baseline->get_Start(), task->Get<System::DateTime>(Tsk::Start()))));
12System::Console::WriteLine(u"BaselineFinish is same as Task Finish: {0}", System::ObjectExt::Box<bool>(System::ObjectExt::Equals(baseline->get_Finish(), task->Get<System::DateTime>(Tsk::Finish()))));
Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.