Actual Properties

The actual properties are used to find out how much time or money has been sent on a task to date.

Working with Actual Properties

The Task exposes a number of properties for determining a task’s actual properties:

The ChildTasksCollector class collects all the child tasks from a given RootTask when used by TaskUtils.

Actual Properties in Microsoft Project

To access these properties in Microsoft Project:

  1. On the View menu, select More Views and then Task Entry.
  2. On the Insert menu, select Column and add the desired columns to the Task Entry form.

Actual properties in a Microsoft Project file checking values of actual fields in Microsoft Project 2016

Getting Actual Properties with Aspose.Tasks

A tasks actual properties can be obtained by traversing the tasks in a project. The code samples below writes the actual properties for all tasks found in a project to a console window.

 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(ActualProperties.class);
 4
 5Project project = new Project(dataDir + "E - 1 Task.mpp");
 6
 7// Create a ChildTasksCollector instance
 8ChildTasksCollector collector = new ChildTasksCollector();
 9
10// Collect all the tasks from RootTask using TaskUtils
11TaskUtils.apply(project.getRootTask(), collector, 0);
12
13// Parse through all the collected tasks
14for (Task task : collector.getTasks()) {
15    System.out.println("Task Name : " + task.get(Tsk.NAME));
16    System.out.println("Actual Start: " + task.get(Tsk.ACTUAL_START).toString());
17    System.out.println("Actual Finish: " + task.get(Tsk.ACTUAL_FINISH).toString());
18    System.out.println("Actual Duration: " + task.get(Tsk.ACTUAL_DURATION).toString());
19    System.out.println("Actual Cost: " + task.get(Tsk.ACTUAL_COST).toString());
20    System.out.println("---------------------------------------------");
21}
Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.