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 below displays the task baseline duration in console window after traversing the task baselines of a task.

 1Project project = new Project();
 2
 3// Creating TaskBaseline
 4Task task = project.RootTask.Children.Add("Task");
 5project.SetBaseline(BaselineType.Baseline);
 6
 7// Display task baseline duration
 8TaskBaseline baseline = task.Baselines.ToList()[0];
 9Console.WriteLine("Baseline duration is 1 day: {0}", baseline.Duration.ToString().Equals("1 day"));
10Console.WriteLine("BaselineStart is same as Task Start: {0}", baseline.Start.Equals(task.Get(Tsk.Start)));
11Console.WriteLine("BaselineFinish is same as Task Finish: {0}", baseline.Finish.Equals(task.Get(Tsk.Finish)));
Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.