Setting TimePhasedData in MPP

Folks,

I have an MPP File, in which I would like to update the work progress by setting the TimePhasedData. Please see the attached screenshot for a better clarification. mpp_req_01.PNG (60.3 KB)

I have tried this one

//JAVA

`ResourceAssignment assn =  project.getResourceAssignments().getByUid(18);
	
	assn.set(Asn.WORK_CONTOUR,WorkContourType.Contoured);

	TimephasedData td = new TimephasedData();
	td.setUid(18);
    td.setStart(assn.get(Asn.START));
    td.setFinish(new Date(assn.get(Asn.START).getTime()+86400000));
    td.setValue("2");
    td.setUnit(TimeUnitType.Hour);
    td.setTimephasedDataType(TimephasedDataType.AssignmentActualWork);
    assn.getTimephasedData().add(td);
	
	project.recalculate();
	project.save(HOME_DIRECTORY+"Project1_2007_out.mpp", SaveFileFormat.MPP);`

But no hope :disappointed_relieved:

My Requirement:

  • I already have an MPP file, that is manually generated using MSP2016.
  • I need to update the actual work done on a weekly basis(or so) in the MPP file using Aspose.

How can I achieve this ???

Any help may be really appreciated.
Thanks in Advance

@sreeharibs95,

Thank you for writing to Aspose support team.

We have analyzed this requirement and observed few issues in latest Aspose.Tasks for Java version. This issue is logged under id:TASKSJAVA-495 for further investigation by the product team. You will be automatically notified once any feedback is received in this regard.

Thankyou for your kind reply.

In the present scenario, is it possible to update the actual work done for a Resource Assignment ? (I am not referring to TimePhasedData now)

@sreeharibs95,

You may please give a try to the following sample code to achieve the functionality.

Project proj = new Project(“Project1.mpp”);
ResourceAssignment ra = proj.getResourceAssignments().getByUid(2);
ra.set(Asn.ACTUAL_WORK, proj.getDuration(3, TimeUnitType.Day));
proj.recalculate();
proj.save(“Project5.mpp”, SaveFileFormat.MPP);

3 posts were split to a new topic: Exception while recalculating the XML project

The issues you have found earlier (filed as TASKSJAVA-495) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by kashif.iqbal