Could you please try carrying out the recalculations by adding the following statements after the foreach loop:
project.CalcTaskIds();
project.CalcTaskUids();
project.CalculateCriticalPath();
project.UpdateReferences();
Task.Recalculate(project.RootTask);
In case the issue still persists, please share your sample MPP file with us for our further investigation into this issue.
I would also like to share that we already have some known problems with the SetPercentComplete functionality for parent tasks that are logged under issue id: TASKS-33726. These are planned to be fixed in lateral versions of Aspose.Tasks for .NET as it requires code refactoring.
SetPercentComplete function requires that all the data references are updated and calculations are done. You may please try the following sample code by using Microsoft 2010 template MPP file and let us know the feedback.
Project proj = new Project(@“D:\Aspose\Blank2010.mpp”); proj.NewTasksAreManual = false; proj.StartDate = new DateTime(2014, 10, 13);
Task task1 = proj.AddTask(“Task 1”); task1.Start = new DateTime(2014, 10, 13); task1.Duration = new TimeSpan(232, 0, 0);
Task task2 = proj.AddTask(“Task 2”);
Task task3 = new Task(“Task 3”); task3.Start = new DateTime(2014, 10, 15); task3.Duration = new TimeSpan(24, 0, 0); task3.DurationFormat = TimeUnitType.Day; task3.Start = DateTime.Parse(“18-Aug-2009 8:00 AM”);
task2.Children.Add(task3);
Task task4 = new Task(“Task 4”); task4.Start = new DateTime(2014, 10, 15); task4.Duration = new TimeSpan(32, 0, 0); task4.DurationFormat = TimeUnitType.Day; task4.Start = DateTime.Parse(“18-Aug-2009 8:00 AM”);
With an older version of Aspose it appears to works.
I really need this, my customers are waiting for a long time for this feature.
I am worried about it. We have a large number of customers that need to export their MPP files. We choose Aspose believing that it would help us with this very important feature.
When Aspose will work on this issue and release a fix ?
I have tried to re-produce the scenario but am afraid that I could not re-produce it as above sample code sets the parent set percent successfully.
Could you please send us a sample console application, along with template MPP file if any, that can be compiled and executed here to re-produce the issue? It will help us to analyze the problem and provide assistance as soon as possible. Also please provide information of previous version of Aspose.Tasks that is working fine as per your requirements.