Managing Task Costs

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

Working with Task Cost

The Tsk exposes a number of 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.

Getting Task Costs

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

 1// Create new project
 2Project project = new Project();
 3
 4// Add task and set cost
 5Task task = project.RootTask.Children.Add("Task");
 6task.Set(Tsk.Cost, 800);
 7
 8// Display cost related properties of task
 9Console.WriteLine(task.Get(Tsk.RemainingCost));
10Console.WriteLine(task.Get(Tsk.FixedCost));
11Console.WriteLine(task.Get(Tsk.CostVariance));
12Console.WriteLine(project.RootTask.Get(Tsk.Cost));
13Console.WriteLine(project.RootTask.Get(Tsk.FixedCost));
14Console.WriteLine(project.RootTask.Get(Tsk.RemainingCost));
15Console.WriteLine(project.RootTask.Get(Tsk.CostVariance));
Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.