Outline Properties

Microsoft Project has an outline structure that lets users get a quick overview of a project. Aspose.Tasks for Java supports this functionality and lets developers control the outline number - where the task appears in a hierarchy - and the outline level - which level of the hierarchy the task is in.

Working with Outline Properties

The Tsk class exposes the OUTLINE_NUMBER and OUTLINE_LEVEL properties for managing outlines associated with a class:

  1. OutlineNumber (string).
  2. OutlineLevel (integer).

Outlines in Microsoft Project

In Microsoft Project, outline number and outline level properties can be viewed on the Task Entry form by adding the columns:

  1. On the Insert menu, select columns.
  2. Add the OutlineNumber and OutlineLevel columns.

Outline properties in Microsoft Project

checking outline properties in Microsoft Project

Getting Outline Properties in Aspose.Tasks

The following example shows how to get the outline level and outline number information about a task using Aspose.Tasks.

 1// For complete examples and data files, please go to https://github.com/aspose-tasks/Aspose.Tasks-for-Java
 2Project project = new Project("Input.mpp");
 3
 4// Create a ChildTasksCollector instance
 5ChildTasksCollector collector = new ChildTasksCollector();
 6
 7// Collect all the tasks from RootTask using TaskUtils
 8TaskUtils.apply(project.getRootTask(), collector, 0);
 9
10// Parse through all the collected tasks
11for (Task tsk : collector.getTasks()) {
12    System.out.println(tsk.get(Tsk.OUTLINE_LEVEL));
13    System.out.println(tsk.get(Tsk.OUTLINE_NUMBER));
14}
15        
Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.