Changing Task Progress

Aspose.Tasks for .NET supports changing a task’s progress in terms of its percentage completion through the Task class’s SetPercentComplete() method. This method takes an integer argument as input for the percentage work completed.

The following piece of code shows how to change the progress of a task.

1Project project = new Project();
2Console.WriteLine("Project Calculation mode is Automatic: {0}", project.CalculationMode.Equals(CalculationMode.Automatic));
3
4Task task = project.RootTask.Children.Add("Task");
5task.Set(Tsk.Duration, project.GetDuration(2));
6task.Set(Tsk.PercentComplete, 50);
Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.