Managing Task Costs

To estimate the cost of a project, tasks are associated with costs. Aspose.Tasks for Java supports this feature of Microsoft Project with a range of properties.

Working with Task Cost

The Task class exposes several properties for working with task cost:

Viewing Task Costs in Microsoft Project

To view task costs in Microsoft Project:

  1. On the Task Entry form, go to the Insert menu and select Columns.
  2. Add the cost columns.

Task cost in Microsoft Project

edit task costs in Microsoft Project

Getting Task Costs

The following examples show how to get a task’s cost using Aspose.Tasks.

 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(ManageTaskCost.class);
 4
 5Project project = new Project();
 6Task task = project.getRootTask().getChildren().add("Task");
 7
 8task.set(Tsk.COST, BigDecimal.valueOf(800));
 9
10System.out.println(task.get(Tsk.REMAINING_COST));
11System.out.println(task.get(Tsk.FIXED_COST));
12System.out.println(task.get(Tsk.COST_VARIANCE));
13System.out.println(project.getRootTask().get(Tsk.COST));
14System.out.println(project.getRootTask().get(Tsk.FIXED_COST));
15System.out.println(project.getRootTask().get(Tsk.REMAINING_COST));
16System.out.println(project.getRootTask().get(Tsk.COST_VARIANCE));
Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.