Editing Task Baseline Durations
Contents
[
Hide
Show
]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.
- Duration supports the TimeSpan data type.
- EstimatedDuration supports the Boolean data type.
After saving a baseline, the task baseline duration can be viewed in Microsoft Project:
- On the View menu, select More Views and ten Task Entry.
- From the Insert menu, select Columns.
- 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)));