Hi Team/(Kashif),
Hi Abhishek,
Thank you for contacting Aspose Support team.
We have tried setting PercentComplete for a task in a test project, but cannot see the issue of values not getting reflected in output MPP. We have attached sample project with input and output files for your reference. Please share your complete sample project along with the input MPP file. We’ll look into it to assist you further.
Hi Maria/Kashif,
Hi Abhishek,
Hi Kashif,
Hi Abhishek,
Hi Kashif,
Hi Abhishek,
Hi Team,
Hi Abhishek,
Hi Abhishek,
Project proj = new Project(@“D:\Blank2010.mpp”);
proj.CalculationMode = CalculationMode.None;Task tsk1 = proj.RootTask.Children.Add(“Task 1”);
Task tsk2 = tsk1.Children.Add(“Task 2”);
tsk2.Set(Tsk.Start, new DateTime(2017, 1, 31, 8, 0, 0));
tsk2.Set(Tsk.Duration, proj.GetDuration(16, TimeUnitType.Hour));
tsk2.Set(Tsk.ActualStart, new DateTime(2017, 1, 31, 8, 0, 0));
tsk2.Set(Tsk.ActualDuration, proj.GetDuration(16 * 0.5, TimeUnitType.Hour));
tsk2.Set(Tsk.PercentComplete, 50);Task tsk3 = tsk1.Children.Add(“Task 3”);
tsk3.Set(Tsk.Start, new DateTime(2017, 2, 2, 8, 0, 0));
tsk3.Set(Tsk.Duration, proj.GetDuration(24, TimeUnitType.Hour));
tsk3.Set(Tsk.ActualStart, new DateTime(2017, 2, 2, 8, 0, 0));
tsk3.Set(Tsk.ActualDuration, proj.GetDuration(24 * 0.17, TimeUnitType.Hour));
tsk3.Set(Tsk.PercentComplete, 17);proj.Recalculate();
proj.Save(“outputAutomatic.xml”, SaveFileFormat.XML);
proj.Save(“outputAutomatic.mpp”, SaveFileFormat.MPP);
This does contain an issue with the Summary task though, but we can fix that for you and provide a hotfix
version in case you show your willingness for opting for Project Mode None. We’ll assist you further in
light of these
Hi Kashif,
Hi Abhishek,
Hi Kashif,
Hi Abhishek,
Hi Kashif,
Hi Abhishek,
I have tried to set the percentage to few random tasks in your sample MPP file and saved the result back to an MPP file. Further test is performed by setting the percentage of same tasks in Microsoft Project 2010 (MSP). After comparison, it is observed that both the results are same.
For example, using Aspose.Tasks, I set percentage complete of tasks 4,5,6 and 20 to 50%. When result is saved in MPP and viewed using MSP, values are 29%, 50%,50% and 50% respectively.
Same steps are performed using MSP and percentages are set to 50% for each task, however the resultant percentages are 30%, 50%,50% and 50% respectively which are similar to Aspose.Tasks results with minor fraction difference.
Please give a try to the following sample code and repeat steps using MSP and share the feedback.
Project proj = new Project(@“10554373_HUAWEI TECHNOLOGIES&CO._02-23-2017_10-59.mpp”);
proj.CalculationMode = CalculationMode.Automatic;
Task tsk = proj.RootTask.Children.GetByUid(4);
tsk.Set(Tsk.PercentComplete, 50);
tsk = proj.RootTask.Children.GetByUid(5);
tsk.Set(Tsk.PercentComplete, 50);
tsk = proj.RootTask.Children.GetByUid(6);
tsk.Set(Tsk.PercentComplete, 50);
tsk = proj.RootTask.Children.GetByUid(20);
tsk.Set(Tsk.PercentComplete, 50);
proj.Save(@"output.mpp", SaveFileFormat.MPP);
```
Hi Team/Kashif,
Hi Abhishek,
Hi Team,