@abhishekpd,
Thank you for your patience.
I have simplified the code (for clarification) and just sharing the code which is related to Aspose.Tasks API. Percentage shall be set once task start and duration is set. Hierarchy shall be set by adding tasks as children tasks to parents. Summary tasks start/duration/percentage shall not be set. Similarly don’t set finish date as start and duration are sufficient. Please give a try to the following sample code and share the feedback.
Project proj = new Project(@"ProjectPlan.mpp");
proj.CalculationMode = CalculationMode.Manual;
Aspose.Tasks.Task dealTask = proj.RootTask.Children.Add("Example");
dealTask.Set(Tsk.IsManual, false);
Aspose.Tasks.Task workStream = dealTask.Children.Add("WS1");
//workStream.Set(Tsk.Start, new DateTime(2017, 1, 1, 0, 0, 0));
workStream.Set(Tsk.IsManual, true);
//workStream.Set(Tsk.OutlineLevel, 2);
//workStream.Set(Tsk.PercentComplete, 50);
Aspose.Tasks.Task tsk1 = workStream.Children.Add("tsk1");
//tsk1.Set(Tsk.OutlineLevel, 3);
tsk1.Set(Tsk.IsManual, false);
tsk1.Set(Tsk.Start, new DateTime(2017, 1, 1, 0, 0, 0));
tsk1.Set(Tsk.Type, TaskType.FixedDuration);
tsk1.Set(Tsk.IsEffortDriven, true);
tsk1.Set(Tsk.Duration, proj.GetDuration(522, TimeUnitType.Day));
//tsk1.Set(Tsk.Finish, new DateTime(2018, 12, 31, 0, 0, 0));//Finish time shall not be set
tsk1.Set(Tsk.PercentComplete, 50);//it should be 50 rather than 0. //It shall be set once start and duration is set
Aspose.Tasks.Task category = workStream.Children.Add("Category1");
category.Set(Tsk.IsManual, false);
//category.Set(Tsk.OutlineLevel, 3);
Aspose.Tasks.Task tsk2 = category.Children.Add("tsk2");
//tsk2.Set(Tsk.OutlineLevel, 4);
tsk2.Set(Tsk.IsManual, false);
tsk2.Set(Tsk.Start, new DateTime(2017, 9, 1, 0, 0, 0));
tsk2.Set(Tsk.Type, TaskType.FixedDuration);
tsk2.Set(Tsk.IsEffortDriven, true);
tsk2.Set(Tsk.Duration, proj.GetDuration(270, TimeUnitType.Day));
//tsk2.Set(Tsk.Finish, new DateTime(2018, 9, 13, 0, 0, 0));//Finish date shall not be set
tsk2.Set(Tsk.PercentComplete, 90);//It shall be set once start and duration is set
proj.Recalculate();
proj.Save("TestOutput.mpp", new MPPSaveOptions() { });