MPPFiles.zip (266.9 KB)
HI Sir,
My requirement is to modify the timephased data value for any resource assignment. and finally save the entire project in different MPP file.
Please find the below code:
string licenseFileName = Path.Combine(dataDir, “Aspose.Total.Product.Family.lic”);
License license = new License();
license.SetLicense(licenseFileName);
Project project = new Project(“GM_VCU_1_5_rough_top_down_1201060_Read.mpp”) { CalculationMode = CalculationMode.None };
Task tsk1 = project.SelectAllChildTasks().FirstOrDefault(t => t.Get(Tsk.Name) == “Hours - Project management”);
foreach (ResourceAssignment assignment in tsk1.Assignments)
{
// Read timephased data
List td = assignment.GetTimephasedData(assignment.Get(Asn.Start), assignment.Get(Asn.Finish), TimephasedDataType.AssignmentRemainingWork).ToList();
foreach (TimephasedData timePhasedValue in td)
{
timePhasedValue.Value = “PT8H0M0S”;
}
}
project.Recalculate();
project.Save(“AfterLinking_out.mpp”, Aspose.Tasks.Saving.SaveFileFormat.MPP);
after debugging i found that in project variable value is updating but not reflecting into output MPP file.