We are working on this issue and require further assistance. It seems that you have sent us empty zip file. Could you please send us the sample MPP again for our testing here? It will help us to analyze the requirement and provide assistance accordingly.
We are analyzing this requirement and request you to spare us little time to complete the analysis. We will write back soon once the feedback is ready to share.
We have tried to clear all the actual fields in the sample project file but faced few problems. This issue is logged under Id:TASKSJAVA-218 for further investigation by the product team. You will be automatically notified once any update is received in this regard.
Please try the following code sample for this purpose. Please note that:
1) It is required to clean not just Tsk.ActualWork, but also Asn.ActualWork, because ResourceAssignments properties are used in Project.recalculate method.
2) You need to set CalculationMode.None in order to avoid ActualWork recalculation in each loop’s iteration.
Sample Code:
Project proj = new Project(“input.mpp”);
proj.setCalculationMode(CalculationMode.None);
ChildTasksCollector collector = new ChildTasksCollector(); // Create a ChildTasksCollector instance TaskUtils.apply(proj.getRootTask(), collector, 5); // Collect all the tasks from RootTask using TaskUtils for (Task tsk : collector.getTasks())
{
tsk.set(Tsk.ACTUAL_WORK, proj.getDuration(0)); for (ResourceAssignment assignment : tsk.getAssignments())
{
assignment.set(Asn.ACTUAL_WORK, proj.getDuration(0));
}
tsk.set(Tsk.ACTUAL_DURATION, proj.getDuration(0));
tsk.set(Tsk.PERCENT_COMPLETE, 0);
tsk.set(Tsk.PERCENT_WORK_COMPLETE, 0);
tsk.set(Tsk.PHYSICAL_PERCENT_COMPLETE, 0);
}
proj.recalculate();
Just in case it can help, we’ve found a couple of things on cleaning actuals with Aspose:
1) You can empty the Actual Finish date field by setting percent complete to any value other than 100%
2) When we set percent complete to 0%, it will NOT empty the Actual Start field (it should, that’s how it works in MSP)
3) If the task has some assignments and a % complete value between 1% and 99%, it will NOT work to set percent complete to 0%. However, if we first set the value to 100% and then set it to 0%, it will work. There’s no such problem for tasks without assignments.
We still haven’t found a way to remove Actual Start dates.