Percentage Complete Calculations
Contents
[
Hide
Show
]Microsoft Project shows the percentage of a task that’s been completed. The percentage can be added manually, by a project manager, or automatically calculated by the application. Aspose.Tasks for .NET supports several percentage calculations related to tasks.
Percentages
The Tsk class exposes a number of properties used to calculate percentages:
- PercentComplete represents the completed percentage of a task’s duration (integer).
- PercentWorkComplete represents the completed percentage of a task’s work (integer).
- PhysicalPercentComplete represents the completed percentage as entered by a project manager (integer).
To see the physical percent complete in Microsoft Project:
- On the Task Entry form, from the Insert menu, select Column.
- Add the column.
To see the completed percentage in Microsoft Project one can double-click the desired column in the Task Entry form.
Getting Percentages in Aspose.Tasks
The following example shows how to get the percentages of work relating to tasks using Aspose.Tasks.
1Project project = new Project("TaskPercentageCompletion.mpp");
2
3// Access tasks and display percentage completion
4foreach (Task task in project.RootTask.Children)
5{
6 Console.WriteLine(task.Get(Tsk.PercentComplete));
7 Console.WriteLine(task.Get(Tsk.PercentWorkComplete).ToString());
8 Console.WriteLine(task.Get(Tsk.PhysicalPercentComplete).ToString());
9}