Editing Task Baseline Durations
A task baseline duration represents the originally planned time required to complete a task when the baseline was saved. By comparing baseline duration with the current (or actual) duration, project managers can identify schedule variances and evaluate the accuracy of initial estimates. Using Aspose.Tasks for .NET, developers can easily read and update baseline durations programmatically without requiring Microsoft Project.
Task Baseline Duration
The following members of the TaskBaseline class are used:
- Duration — returns or sets the scheduled duration saved in the baseline.
- Type:
TimeSpan
- Type:
- EstimatedDuration — specifies whether the baseline duration was originally estimated.
- Type:
Boolean
- 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.
Viewing Baseline Duration in Microsoft Project
To manually verify the baseline duration in Microsoft Project:
- On the View menu, select More Views, then choose Task Entry.
- Open the Insert menu and select Column.
- Add the Baseline Duration column to the view.
Getting Task Baseline Duration using Aspose.Tasks
The following code iterates over task baselines and prints their durations to the console:
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)));
Practical Use Cases
- Correcting estimates — adjust baseline duration after refining planning assumptions
- Variance analysis — compare planned vs. actual duration to identify schedule slippage
- Project reporting — generate automated reports with baseline vs. actual durations
Conclusion
Baseline durations are a vital metric for project performance tracking. With Aspose.Tasks for .NET, you can not only extract but also update these values programmatically, making it easier to maintain accurate baselines, support variance reporting, and integrate scheduling data with other systems.