Wrong Assignment Units for Material Resources

Hi,


Using the code below (code 01), can create the file correctly, resources containing the units correctly, but to reopen the file created and run only the code 02 units of resources are changed, I believe multiplied.

Could verify?

============================code 01============================
new Aspose.Tasks.License().SetLicense(@“c:\Aspose.Tasks.lic”);

Project project = new Project(@“Saved.mpp”);
Task tsk3 = project.RootTask.Children.First().Children.First().Children.First();
tsk3.Set(Tsk.Duration, tsk3.ParentProject.GetDuration(10, TimeUnitType.Day));
project.Save(@“Output.mpp”, Aspose.Tasks.Saving.SaveFileFormat.MPP);

Project project = new Project(@“Test_EmptyProject.mpp”);
project.CalculationMode = CalculationMode.Automatic;
project.Set(Prj.NewTasksAreManual, false);

Task tsk1 = project.RootTask.Children.Add(“Task 1”);
Task tsk2 = tsk1.Children.Add(“Task 2”);

project.Set(Prj.NewTasksAreManual, true);

Task tsk3 = tsk2.Children.Add(“Task 3”);
tsk3.Set(Tsk.IsManual, true);
tsk3.Set(Tsk.Start, new DateTime(2015, 2, 6, 9, 0, 0));
tsk3.Set(Tsk.Duration, tsk3.ParentProject.GetDuration(10, TimeUnitType.Day));

tsk3.Set(Tsk.ManualStart, tsk3.Get(Tsk.Start));
tsk3.Set(Tsk.ManualFinish, tsk3.Get(Tsk.Finish));
tsk3.Set(Tsk.ManualDuration, tsk3.Get(Tsk.Duration));

#region [Set Resources]

Resource rsc1 = project.Resources.Add(“Resource 1”);
rsc1.Set(Rsc.Type, ResourceType.Material);
Resource rsc2 = project.Resources.Add(“Resource 2”);
rsc2.Set(Rsc.Type, ResourceType.Material);

#endregion [Set Resources]

#region [Set Assignments]
project.ResourceAssignments.Add(tsk3, rsc1, 4);
project.ResourceAssignments.Add(tsk3, rsc2, 8);
#endregion [Set Assignments]

project.Recalculate();
project.Save(@“Output.mpp”, Aspose.Tasks.Saving.SaveFileFormat.MPP);
=======================================================
=======================code 02==========================
Project project = new Project(@“Saved.mpp”);
Task tsk3 = project.RootTask.Children.First().Children.First().Children.First();
tsk3.Set(Tsk.Duration, tsk3.ParentProject.GetDuration(10, TimeUnitType.Day));
project.Save(@“Saved.mpp”, Aspose.Tasks.Saving.SaveFileFormat.MPP);
=============================================================

Thanks.

Hi Anderson,


Could you please send me the “Saved.mpp” file used in the above sample code? It will help us to simulate the same scenario at our end and share our feedback at the earliest.
Hi, Muhammad,

Follows the file.
Note that the units of the funds are with different time of file creation values.
Just ran the code below to reopen the file.

Project project = new Project(@"Saved.mpp");
Task tsk3 = project.RootTask.Children.First().Children.First().Children.First();
tsk3.Set(Tsk.Duration, tsk3.ParentProject.GetDuration(10, TimeUnitType.Day));
project.Save(@"Saved.mpp", Aspose.Tasks.Saving.SaveFileFormat.MPP);

Thanks.

Hi Anderson,


Thank you for providing the sample mpp file. I have re-produced the issue and have logged it as TASKS-34056 in our issue tracking system for further investigation by the product team. I shall write here as soon as some feedback is received in this regard.

The issues you have found earlier (filed as TASKS-34056) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

The issues you have found earlier (filed as ) have been fixed in this Aspose.Words for JasperReports 18.3 update.