Unable to set completion % in MPP

Hi Team/(Kashif),


I am unable to set the completion % in Aspose.
I am using the below line of code

//Adding % Complete.
tsk.Set(Tsk.PercentComplete, Convert.ToInt32(taskItem.CompletionPct));

where taskItem.CompletionPct = value.

Please let me know how can I do the fix.I have put break point and saw that the value is coming properly and no error is getting thrown by the above line. but the % value is not getting reflected in MPP.

Thanks
Abhishek Prasad

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,


PFA the required project. Please run and check why the value is not getting set in % complete field.
Please also check if the template is working fine/ doesnot have any issues.

Thanks
Abhishek Prasad

Hi Abhishek,


I have tried your template file and sample code but could not re-produce the issue. Here the snapshot of the Project_out.mpp file is attached for your reference. Could you please share the output file and snapshot where issue is highlighted for our reference? Also share your Microsoft Project version with us.

Hi Kashif,


Please try with setting :-

project.CalculationMode = CalculationMode.Manual; (Using this for performance fix. Automatic mode is taking more time.)
in the sample console application given by you.

I checked that it is not getting set on using the same.

Also,

When I am removing the calculation mode manual then I am getting random values set in the % completion as I am using the parent child relation.

Is the % completion dependent on parent child calculation?

Please reply ASAP.

Thanks in advance.

Regards
Abhishek Prasad




Hi Abhishek,


Thank you for writing to Aspose Support team.

We have investigated the issue at our end and were able to observe the differences in different project calculation modes with MPP file format. These findings have been forwarded to our Product team via issue id: TASKSNET-1796. We’ll update you here once there is some information or fix available in this regard.

Hi Kashif,


Any Updates on this, we need the solution ASAP. Please let me know.

Thanks & Regards
Abhishek Prasad

Hi Abhishek,


This issue is logged too recently and still is in queue to be addressed by the product team. Once issue is reviewed and analyzed by the product team, then it will be possible for us to provide some ETA. You will be notified once any update is received by the product team.

Thank you for your patience and understanding is this regard.

Hi Team,


Our Project is going globally live on 1st of March 2017.
Please Provide an ETA.

We need the fix ASAP.

Thanks !

Regards
Abhishek Prasad


Hi Abhishek,


We have requested an ETA for the resolution of this issue and will update you here as soon as some information is available in this regard.

Hi Abhishek,


Resolution of this issue in Manual Mode is not possible till 1st March. However, if you are comfortable working with None mode of the API, you can use the following sample code to achieve this:

Sample Code:

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,


Thanks for your responses.
Can you please check for the updates on TASKSNET-1796.
We need the fix ASAP.

Currently we are trying to use Calculation Mode as Automatic.

Thanks !!

Regards
Abhishek Prasad


Hi Abhishek,


The reported issue, TASKSNET-1796, is related to working with Manual mode and we shared our findings with you for our incapability to fix it by 1st March. Since, now you are saying that you are working with Automatic mode, resolution of this issue even lately may not get you correct results. If CalculationMode.None can be helpful to you, we can share your feedback with our Product team for looking into fixing this for None mode. For Automatic mode, please share your sample code that you are trying at your end so that we could report it to our Product team for further investigation.

Hi Kashif,


Automatic Mode is working as expected but there is performance constraint associated with it. (Taking 50 minutes to download for 4000 task items compared to 3 minutes when using manual mode.)

In None mode the dates are not coming properly.

We have to do it in Manual Mode Only.

As such we need the fix ASAP. Do let me know whenever the fix is available after 1st of March.


Thanks
Abhishek Prasad


Hi Abhishek,


I have checked the status of this ticket and it is still not resolved. I have already shared the urgency to the product team but due to complexity of the issue, it is still pending. I will write back here as soon as some feedback is received in this regard.

Hi Kashif,


(As an alternative to Calculation mode as Manual) for using it till the Manual mode fix is available.

I tried testing with Calculation mode as None and found that the Start and Finish dates are not coming in the MPP.

I tried testing with Calculation Mode as Automatic and found out that the behavior is unpredictable and is date dependent (Start & Finish).

If there is no underline date errors then the % completion is getting set properly otherwise the behavior is unpredictable.
Sometimes it is setting the value as 0% / 1% .

If it works then we can use the automatic mode as an alternative till manual fix is available.

Please try testing in automatic mode with the attached Sample template for % completion.

Regards
Abhishek Prasad








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,


Any updates on TASKSNET-1796.

Thanks in advance.

Regards
Abhishek Prasad

Hi Abhishek,


Our Product team has anlayzed this issue and it involves a little complexity. For this reason, there is no ETA information available in this regard. Could you please share with us again if the CalculationMode.None is of no help to you?

Hi Team,


Any updates on this. Calculation Mode as Manual Fix?TASKSNET-1796.

Thanks
Abhishek Prasad