Baseline Task Scheduling
Contents
[
Hide
Show
]Baseline Task Scheduling
The Start and Finish properties exposed by the TaskBaseLine class are used to read and write a task’s start and finish dates when the baseline was saved. Both properties support the DateTime data type.
After saving a baseline, the task baseline schedule can be viewed in Microsoft Project:
- From the View menu, select More Views and then Task Entry.
- From the Insert menu, select Columns.
- Add the desired columns.
Getting Task Baseline Schedule using Aspose.Tasks
The code below displays the task baseline schedule in a console window after traversing a task’s baselines.
1Project project = new Project();
2
3// Creating TaskBaseline
4Task task = project.RootTask.Children.Add("Task");
5project.SetBaseline(BaselineType.Baseline);
6
7// Display task baseline schedule
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)));