We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Modifying TimePhased Data and saving into MPP file

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.

@chetanbhola

We need to further investigate the issue on our end. A ticket with ID TASKSNET-10342 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be fixed.