We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Marking Tasks As Complete (Task Complete Indicator Not Displayed)

Hi,


I’ve been trying to mark a task as complete with no such luck. The Tasks % Work Complete is set to 100%, the Remaining Work is set to 0 and both the Actual Work and Regular Work fields match. However, I never get the Task Complete check mark indicator displayed in the Indicators column when I open the project file. Any idea as to what I might be missing?

I’ve attached the code used to produce the output file as well as the output file itself and the template used. I’m using MS Project 2010 and Aspose Tasks 9.3.0.

Thanks, Calvin

Hi Calvin,

Thank you for contacting Aspose support team.

I have tried the scenario where task percentage complete is set to 100%. It is observed that task complete mark is displayed using MSP 2010. Could you please give a try to the following sample code and let us know the feedback? If issue is not resolved, please modify this simplified code to re-produce the issue.

Project proj = new Project(@“Blank2010.mpp”);proj.Set(Prj.NewTasksAreManual, false);

proj.Set(Prj.StartDate, new DateTime(2016, 5, 23, 8, 0, 0));

Task task1 = proj.RootTask.Children.Add("Task 1");

task1.Set(Tsk.Start, new DateTime(2016, 5, 23, 8, 0, 0));

task1.Set(Tsk.Duration, proj.GetDuration(16, TimeUnitType.Hour));

task1.Set(Tsk.PercentComplete, 100);

Task task2 = proj.RootTask.Children.Add("Task 2");

task2.Set(Tsk.Start, new DateTime(2016, 5, 23, 8, 0, 0));

task2.Set(Tsk.Duration, proj.GetDuration(16, TimeUnitType.Hour));

task2.Set(Tsk.PercentComplete, 100);

proj.Save(@"ProjectNet.mpp", SaveFileFormat.MPP);


Hi Kashif,


The completed indicator displays as expected when I execute the code you’re provided. If modified your code to produce the issue. Basically, I’ve set the calculation mode to None and added a project recalculation call at the end (in an attempt to speed up performance on larger MSP file exports):

Project proj = new Project(“C:\Blank2010.mpp”); proj.Set(Prj.NewTasksAreManual, false); proj.CalculationMode = CalculationMode.None;
proj.Set(Prj.StartDate, new DateTime(2016, 5, 23, 8, 0, 0));
Task task1 = proj.RootTask.Children.Add(“Task 1”);
task1.Set(Tsk.Start, new DateTime(2016, 5, 23, 8, 0, 0));
task1.Set(Tsk.Duration, proj.GetDuration(16, TimeUnitType.Hour));
task1.Set(Tsk.PercentComplete, 100);

Task task2 = proj.RootTask.Children.Add(“Task 2”);
task2.Set(Tsk.Start, new DateTime(2016, 5, 23, 8, 0, 0));
task2.Set(Tsk.Duration, proj.GetDuration(16, TimeUnitType.Hour));
task2.Set(Tsk.PercentComplete, 100);

proj.Recalculate();

proj.Save(“C:\ProjectNet.mpp”, SaveFileFormat.MPP);

Thanks, Calvin

Hi Calvin,


Thank you for sharing additional information.

With calculation mode None, you need to specify each and every parameter for the task. In this case, setting the ActualStart ad ActualDuration parameters is required. But we have found that this works for generated XML output only, and is still missing in the output MPP file. The issue has been logged as TASKSNET-1576 in our issue tracking system for further investigation by our Product team. We’ll update you here as soon as there is some information available in this regard.

Hi Kashif,


Can you provide an update/eta on the this issue?

Thanks, Calvin

Hi Calvin,


The issue is planned to be fixed in Jan 2017 release of the API. We’ll update you here once there is some information available in this regard.

The issues you have found earlier (filed as TASKSNET-1576) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

Hi Kashif,


On a previous post of yours you indicated that with calculation mode set to None, I’ll need to specify each and every parameter for the task. You indicated that setting the ActualStart and ActualDuration parameters are required. If a task is complete I can set this as you have indicated.

If for some reason the user now marks the task as incomplete how do I push this out to MS Project? I can set the ActualDuration to zero but how do I reset the ActualStart value back to NA (This is what is displayed in MS Project if I were to mark the task as incomplete via MS Project)?

Thanks, Calvin

Hi Calvin,


Thank you for contacting us again.

You may please set ActualStart value to DateTime.MinValue to set it to NA in MSP. Please give it a try and share the feedback.

Hi Kashif,


Setting the ActualStart value to DateTime.MinValue successfully set the value to NA in MSP.

Thanks for your help.

Calvin

Hi Calvin,


You are welcome and please feel free to write to us if you have any further query in this regard.