Task splitting for non-working days in PPM export is not working (C# .NET)

I’m using the 18.7.1 version of Aspose.

I’m trying to export in different format (PDF and PPM).

Some of my tasks are split, so when I export in PDF format, it works and I see my split parts. However, when I export in PPM, my split parts do not appear and tasks show as non split tasks.

How can I solve this problem?

Thx

@Rag3lib,

We believe you wanted to write MPP rather than PPM. Please share your sample input file with us for further investigation at our end.

Sorry for the mistake.
Please find attach to this post the program.cs file and the template used in input.

Program.zip (28.0 KB)

@Rag3lib,

We still couldn’t find any attachment project here for investigation at our end.

I’have provide you the program in the previous reply but still no answer.
Can you give me some informations about my request.

Thanks

@Rag3lib,

Thank you for contacting Aspose support again.

This issue is re-produced and logged under Id:TASKSNET-2686 for detailed analysis later. We will write back here as soon as some feedback is available in this regard.

Hi, can you give me informations about this bug resolution please?
Can you give me a resolution date?

@Rag3lib

Thank you for writing back to us.

This issue is still under investigation and we are working on this. This shall probably be resolved with Aspose.Tasks for .NET 19.1 Release.

Hi,

you say to me that the fix will be available for the 19.1 release. But, in the release note (19.1 and 19.2), bugs are not referenced.
Theses bug are criticals for our needs, can you provide provide a resolution date.

Thanks
Gabriel

@Rag3lib

The issue is not resolved yet and it is planned to be a part of our next version which is 19.3. We will update you here once we have more information to share.

Sorry for disturbing you again. We have a meeting with our customer on monday. And we have to act for a resolution in the next month for this issue.

If not, we need to change our schedule. So can you please confirm me if this issue will be resolved in the next release. And if yes, can you provide me a release date.

Thanks and sorry again for my insistence.

Regards.

@Rag3lib,

I regret to share that at present the issue is still unresolved. I have added comments in our issue tracking system for getting updated status of the issue and will share feedback with you as soon as the issue will be fixed.

@Rag3lib Hello!

Sorry for a delay!

Presented below is the code sample which generates the correct file

var t1StartDate = new DateTime(2018, 7, 9, 0, 0, 0);
var t2StartDate = new DateTime(2018, 7, 9, 0, 0, 0);
var t2EndDate = new DateTime(2018, 7, 19, 0, 0, 0);
var t3StartDate = new DateTime(2018, 7, 9, 0, 0, 0);
var t3EndDate = new DateTime(2018, 7, 27, 0, 0, 0);

var project = new Project(Paths.BugsFolder + @"TASKSNET-2686/Modele_Planning_paysage.mpp");
project.Set(Prj.NewTasksAreManual, false);
project.Set(Prj.StartDate, new DateTime(2018, 7, 9, 0, 0, 0));
project.Set(Prj.FinishDate, new DateTime(2018, 8, 31, 0, 0, 0));

var calendar = project.Get(Prj.Calendar);
Task t1 = project.RootTask.Children.Add("Task 01");
t1.Set(Tsk.Calendar, calendar);
t1.Set(Tsk.ConstraintType, ConstraintType.MustStartOn);
t1.Set(Tsk.ConstraintDate, t1StartDate);
t1.Set(Tsk.Duration, project.GetDuration(5, TimeUnitType.Day));
var resourceAssignment1 = project.ResourceAssignments.Add(t1, null);
resourceAssignment1.TimephasedDataFromTaskDuration(calendar);

var t2Duration = (t2EndDate.AddDays(1) - t2StartDate).TotalDays;
var t2 = project.RootTask.Children.Add("Task 02");
t2.Set(Tsk.Calendar, calendar);
t2.Set(Tsk.ConstraintType, ConstraintType.MustStartOn);
t2.Set(Tsk.ConstraintDate, t2StartDate);
t2.Set(Tsk.Duration, project.GetDuration(t2Duration, TimeUnitType.Day));

var resourceAssignment2 = project.ResourceAssignments.Add(t2, null);
resourceAssignment2.TimephasedDataFromTaskDuration(calendar);
resourceAssignment2.SplitTask(new DateTime(2018, 7, 11, 0, 0, 0), new DateTime(2018, 7, 12, 0, 0, 0), calendar);

var t3Duration = (t3EndDate.AddDays(1) - t3StartDate).TotalDays;
var t3 = project.RootTask.Children.Add("Task 03");
t3.Set(Tsk.Calendar, calendar);
t3.Set(Tsk.ConstraintType, ConstraintType.MustStartOn);
t3.Set(Tsk.ConstraintDate, t3StartDate);
t3.Set(Tsk.Duration, project.GetDuration(t3Duration, TimeUnitType.Day));

var resourceAssignment3 = project.ResourceAssignments.Add(t3, null);
resourceAssignment3.TimephasedDataFromTaskDuration(calendar);
resourceAssignment3.SplitTask(new DateTime(2018, 7, 11, 0, 0, 0), new DateTime(2018, 7, 12, 0, 0, 0), calendar);
resourceAssignment3.SplitTask(new DateTime(2018, 7, 24, 0, 0, 0), new DateTime(2018, 7, 25, 0, 0, 0), calendar);

project.Save("result.mpp", SaveFileFormat.MPP);

Unfortunately, there were issues with MPP format in Aspose.Tasks, so this example will be worked starting since Aspose Tasks for .NET 19.3 which will be released in the first decade of March.

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

Hi,
After some test and integration in our application, we found that in some cases, the multiple split doesn’t work well.
The simpliest way is to suround the first splitpart over a week end.
Please find the code below:

        Project project = new Project(path + "\\Modele_Planning_paysage.mpp");

        var t3StartDate =   new DateTime(2019, 4, 8, 0, 0, 0);
        var t3EndDate =     new DateTime(2019, 4, 26, 0, 0, 0);

        project.Set(Prj.NewTasksAreManual, false);
        project.Set(Prj.StartDate, new DateTime(2019, 4, 8, 0, 0, 0));
        project.Set(Prj.FinishDate, new DateTime(2019, 5, 1, 0, 0, 0));

        var calendar = project.Get(Prj.Calendar);
        var t3Duration = (t3EndDate.AddDays(1) - t3StartDate).TotalDays;
        var t3 = project.RootTask.Children.Add("Task 03");
        t3.Set(Tsk.Calendar, calendar);
        t3.Set(Tsk.ConstraintType, ConstraintType.MustStartOn);
        t3.Set(Tsk.ConstraintDate, t3StartDate);
        t3.Set(Tsk.Duration, project.GetDuration(t3Duration, TimeUnitType.Day));

        var resourceAssignment3 = project.ResourceAssignments.Add(t3, null);
        resourceAssignment3.TimephasedDataFromTaskDuration(calendar);
        resourceAssignment3.SplitTask(new DateTime(2019, 4, 12, 0, 0, 0), new DateTime(2019, 4, 15, 0, 0, 0), calendar);
        resourceAssignment3.SplitTask(new DateTime(2019, 4, 23, 0, 0, 0), new DateTime(2019, 4, 24, 0, 0, 0), calendar);

        project.Save("result.mpp", SaveFileFormat.MPP);

The first SplitTask start a thursday and restart a monday.

If you try:

  • resourceAssignment3.SplitTask(new DateTime(2019, 4, 12, 0, 0, 0), new DateTime(2019, 4, 13, 0, 0, 0), calendar); The output in KO
  • resourceAssignment3.SplitTask(new DateTime(2019, 4, 12, 0, 0, 0), new DateTime(2019, 4, 16, 0, 0, 0), calendar); The output in OK

I think it’s a wrong gestion of non working days and week ends.

Regards.
Gabriel

@Rag3lib,

I have observed the information and code sample shared by you. Can you please elaborate what output you expect and what you are getting. Please also provide the source file used so that we may log request in our issue tracking system for investigation.

Hi,

Please find attach to this post two files:
“Modele_Planning_paysage.mpp” => input template file
“result.mpp” => the expected result

Regards.
Gabriel

AsposeRequest.zip (5.6 MB)

@Rag3lib,

Thank you for sharing the information. An issue with ID TASKSNET-3147 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.

Hi @mudassir.fayyaz
Thank for the quick answer.

This bug seems to be reproduce too in the case the segment restart after a non working day.
For exemple if i have a week day set a non working, the splits doesn’t take effect if a segment restart the day after this non working day. Hope that element help you to resolve this issue.

Regards,
Gabriel

@Rag3lib,

Thank you for sharing the additional information. We will share the feedback with you as soon as the issue will be fixed.