Thanks for the code @kashif.iqbal . But something went wrong during ‘project.recalculate()’
Exception in thread "main" class com.aspose.tasks.private.Exceptions.ArgumentException: remainingWork
com.aspose.tasks.xp.h(Unknown Source)
com.aspose.tasks.fy.a(Unknown Source)
com.aspose.tasks.fy.a(Unknown Source)
com.aspose.tasks.ResourceAssignment.a(Unknown Source)
com.aspose.tasks.cgi.b(Unknown Source)
com.aspose.tasks.cgi.d(Unknown Source)
com.aspose.tasks.cgc.c(Unknown Source)
com.aspose.tasks.cct.b(Unknown Source)
com.aspose.tasks.cct.a(Unknown Source)
com.aspose.tasks.Project.recalculate(Unknown Source)
com.aspose.tasks.Project.recalculate(Unknown Source)
me.harisree.aspose.utils.AsposeTest.main(AsposeTest.java:96)
at com.aspose.tasks.xp.h(Unknown Source)
at com.aspose.tasks.fy.a(Unknown Source)
at com.aspose.tasks.fy.a(Unknown Source)
at com.aspose.tasks.ResourceAssignment.a(Unknown Source)
at com.aspose.tasks.cgi.b(Unknown Source)
at com.aspose.tasks.cgi.d(Unknown Source)
at com.aspose.tasks.cgc.c(Unknown Source)
at com.aspose.tasks.cct.b(Unknown Source)
at com.aspose.tasks.cct.a(Unknown Source)
at com.aspose.tasks.Project.recalculate(Unknown Source)
at com.aspose.tasks.Project.recalculate(Unknown Source)
at me.harisree.aspose.utils.AsposeTest.main(AsposeTest.java:96)
Code fragment:
ResourceAssignment ra = project.getResourceAssignments().getByUid(17);
System.out.println(ra.toString());
ra.set(Asn.ACTUAL_WORK, project.getDuration(1, TimeUnitType.Day));
project.recalculate();
project.save(HOME_DIRECTORY+"Project1_2007_out.mpp", SaveFileFormat.MPP);
System.out.println("Done");
Any hope …?