Hi,
Please run the code as below:
FileInputStream fstream = null;
try {
// Create a stream object containing the license file
fstream = new FileInputStream("Aspose.Tasks.lic");
// Instantiate the License class
License license = new License();
// Set the license through the stream object
license.setLicense(fstream);
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
fstream.close();
} catch (IOException e) {
e.printStackTrace();
}
}
Project asProject = new Project("Empty_Project.mpp");
Task taskSummary = asProject.getRootTask().getChildren().add("Summary");
Task taskNode1 = taskSummary.getChildren().add("Node1");
taskNode1.set(Tsk.START, formatter2.parse("06/29/16 08:00:00"));
taskNode1.set(Tsk.DURATION, asProject.getDuration(9, TimeUnitType.Day));
taskNode1.set(Tsk.WORK, asProject.getDuration(72, TimeUnitType.Hour));
Task taskNode2 = taskSummary.getChildren().add("Node2");
taskNode2.set(Tsk.START, formatter2.parse("06/29/16 08:00:00"));
taskNode2.set(Tsk.DURATION, asProject.getDuration(9, TimeUnitType.Day));
taskNode2.set(Tsk.WORK, asProject.getDuration(72, TimeUnitType.Hour));
asProject.recalculate();
// Save the Project
asProject.save("output_summary.mpp", SaveFileFormat.MPP);
System.out.println("ok");
}
My question is why the summary node can not roll up automatically?
zhencheng.guo
Best Regards!