Regarding Import functionality fix

Hi Kashif,

Any updates on the same.
I was unable to find this thread of our conversation, it seems like the site is updated.
Please have a look of this,

View the complete topic at: Unable to set completion % in MPP

Posted By: kashif.iqbal in Aspose.Tasks Product Family
Subject: Re: Unable to set completion % in MPP.


Hi Abhishek,

It is planned to be released at the end of July 2017. We’ll notify you here once the fix version is available for download.

@abhishekpd,

Thank you for writing to Aspose support team again.

As mentioned earlier, due to some complexity, this issue is still not resolved and another ticket TASKSNET-2035 had been created for product team consideration. This issue shall be further tracked under this new Id. You will be automatically notified once any update is received in this regard.

@abhishekpd,

This issue has been fixed in latest version of Aspose.Tasks for .NET 17.9. Please let us know if we can be of any additional help to you with respect to your queries related to API.

Hi Kashif,

We have tested with your latest 17.9 MPP fix. but still we are not getting correct % Complete. earlier we were getting 0% for each task but now we getting value but it is not same what we are writing through below code

tsk.Set(Tsk.PercentComplete, Convert.ToInt32(taskItem.CompletionPct));

In screenshot we are also writing same value (taskItem.CompletionPct) in another custom column Correct % Complete.

Sending MPP file which we have generated through latest 17.9 release.

Issue_MPP.JPG (248.1 KB)
TestingNewASPOSEfix.zip (59.1 KB)

@abhishekpd,

Thank you for writing to us again.

I have tried this new release with my sample code and observed that it worked fine as compared to previous version 17.7. Could you please send us the simple console application which can be compiled and executed here to produce the same MPP file which you have shared above. It will help us to observe the scenario and provide assistance accordingly.

I tried following simple code:

Project proj = new Project(@"Blank2010.mpp");
//Project proj = new Project();           //Use if you don't want to load a template MPP file.

proj.CalculationMode = CalculationMode.Manual;

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));

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));

tsk2.Set(Tsk.PercentComplete, 50);
tsk3.Set(Tsk.PercentComplete, 17);

proj.Recalculate();
proj.Save(@"outputManual17.9.mpp", SaveFileFormat.MPP);

Hi kashif,

Thanks for reply. I am sending you a sample project in which we having same logic which we are using in our actual project.

Plz put your latest aspose.task dll in bin folder & license file in debug folder to run this program. it will generate a Sample.mpp file in C: drive.

In generated file plz check % complete is not coming same which we are writing.

MPP_Test_Project.zip (100.1 KB)

@abhishekpd,

Thank you for providing the sample project. We are working on this issue and facing problem due to lengthy code. Could you please simplify the code by removing extra code (like setting extended attribute, resources etc.) wherever possible and provide us minimum code which can be used to observe the issue? It will help us to analyze the problem and provide assistance at the earliest.

Hi kashif,

I am sending you minimized code. PFA. I hope this will help.
I have removed code of writing extended attribute. But When I am removing resource logic the generated file %Complete become zero for all task. and if we have resource then % complete showing wrong values.
MPP_Test_Project_Min.zip (96.7 KB)

@abhishekpd,

Thank you for providing simplified code. We are working on this issue and will write back soon to share the feedback.

@abhishekpd,

Thank you for your patience.

I have simplified the code (for clarification) and just sharing the code which is related to Aspose.Tasks API. Percentage shall be set once task start and duration is set. Hierarchy shall be set by adding tasks as children tasks to parents. Summary tasks start/duration/percentage shall not be set. Similarly don’t set finish date as start and duration are sufficient. Please give a try to the following sample code and share the feedback.

Project proj = new Project(@"ProjectPlan.mpp");
proj.CalculationMode = CalculationMode.Manual;

Aspose.Tasks.Task dealTask = proj.RootTask.Children.Add("Example");
dealTask.Set(Tsk.IsManual, false);

Aspose.Tasks.Task workStream = dealTask.Children.Add("WS1");
//workStream.Set(Tsk.Start, new DateTime(2017, 1, 1, 0, 0, 0));
workStream.Set(Tsk.IsManual, true);
//workStream.Set(Tsk.OutlineLevel, 2);
//workStream.Set(Tsk.PercentComplete, 50);

Aspose.Tasks.Task tsk1 = workStream.Children.Add("tsk1");
//tsk1.Set(Tsk.OutlineLevel, 3);
tsk1.Set(Tsk.IsManual, false);
tsk1.Set(Tsk.Start, new DateTime(2017, 1, 1, 0, 0, 0));
tsk1.Set(Tsk.Type, TaskType.FixedDuration);
tsk1.Set(Tsk.IsEffortDriven, true);
tsk1.Set(Tsk.Duration, proj.GetDuration(522, TimeUnitType.Day));
//tsk1.Set(Tsk.Finish, new DateTime(2018, 12, 31, 0, 0, 0));//Finish time shall not be set
tsk1.Set(Tsk.PercentComplete, 50);//it should be 50 rather than 0. //It shall be set once start and duration is set

Aspose.Tasks.Task category = workStream.Children.Add("Category1");
category.Set(Tsk.IsManual, false);
//category.Set(Tsk.OutlineLevel, 3);

Aspose.Tasks.Task tsk2 = category.Children.Add("tsk2");
//tsk2.Set(Tsk.OutlineLevel, 4);
tsk2.Set(Tsk.IsManual, false);
tsk2.Set(Tsk.Start, new DateTime(2017, 9, 1, 0, 0, 0));
tsk2.Set(Tsk.Type, TaskType.FixedDuration);
tsk2.Set(Tsk.IsEffortDriven, true);
tsk2.Set(Tsk.Duration, proj.GetDuration(270, TimeUnitType.Day));
//tsk2.Set(Tsk.Finish, new DateTime(2018, 9, 13, 0, 0, 0));//Finish date shall not be set
tsk2.Set(Tsk.PercentComplete, 90);//It shall be set once start and duration is set

proj.Recalculate();
proj.Save("TestOutput.mpp", new MPPSaveOptions() { });

Hi Kashif,

Thanks for your reply. You given the solution that works at least child level.
But previous code example which I sent, there are one additional blank task is added under WS1. Due to this additional task, WS1 % complete is not calculating correct. Plz check in previous code and tell why this additional row is coming. Sending you screenshot of additional task is added. MPP_issue.JPG (70.3 KB)

@abhishekpd,

We are working on it and will share feedback soon.

@abhishekpd,

There seems some logical issue in your program. You may please consider following line of code:

tsk = projectWrite.RootTask.Children.Add(taskItem.TaskDesc);
Console.WriteLine("Task No = " + tsk.Get(Tsk.Id));//Newly added
Console.WriteLine("taskItem.TaskDesc => " + taskItem.TaskDesc);//Newly added

You will see that here taskItem.TaskDesc is an empty string, hence no name is assigned to task 3 and 5. You may re-visit your program logic and provide valid string here.

Please feel free to write us back if some issue is there in Aspose.Tasks code. Also please provide trimmed code as given above for our analysis here as it helps us to provide assistance in a timely manner.