Baseline Task Scheduling

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 Date data type.

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

  1. From the View menu, select More Views and then Task Entry.
  2. From the Insert menu, select Columns.
  3. Add the desired columns.

Baseline start and end dates in Microsoft Project

show task baseline start/finish in Microsoft Project

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.

 1// For complete examples and data files, please go to https://github.com/aspose-tasks/Aspose.Tasks-for-Java
 2// The path to the documents directory.
 3String dataDir = Utils.getDataDir(BaselineTaskScheduling.class);
 4
 5long OneSec = 10000000;// microsecond * 10
 6long OneMin = 60 * OneSec;
 7long OneHour = 60 * OneMin;
 8
 9Project project = new Project();
10// Creating TaskBaseline:
11Task task = project.getRootTask().getChildren().add("Task");
12project.setBaseline(BaselineType.Baseline);
13
14TaskBaseline baseline = task.getBaselines().toList().get(0);
15System.out.println(baseline.getDuration().toDouble() / OneHour + " Hours");
16System.out.println("Baseline Start: " + baseline.getStart());
17System.out.println("Baseline Finish: " + baseline.getFinish());
Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.