Assignment WorkContourType

Hi

When I create Assignment Timephased Data and save as mpp file it seems necessary to set the Assignment WorkContourType manually.
If the WorkContourType is not set correct I get some strange Results in MSProject2010

Sometimes the result looks OK in a higher MSProject Version until you do some simple changes in MSProject like defining a predecessor.

Please have a look at the following code which set the WorkContourType wrong (WorkContourType.Contoured) and see the Result (Gantt Bar) in MSProject.

Is there a way to set the WorkContourType automatically?



Dim dHours As Double
Dim moTask1 As Aspose.Tasks.Task
Dim moRes1 As Aspose.Tasks.Resource
Dim moAssign1 As Aspose.Tasks.ResourceAssignment



EnableAsposeLicense()
moProject = New Aspose.Tasks.Project(“c:\empty2010.mpp”)



'Task1 Asignemnt WorkContourType.Contoured TimePhasedata 8h,8h
moTask1 = moProject.RootTask.Children.Add(“Task1”)
moTask1.[Set](Tsk.Type, TaskType.FixedUnits)
moTask1.[Set](Tsk.Start, New Date(2016, 10, 10))

dHours = moProject.Get(Prj.Calendar).GetWorkingHours(dtDateFromDate(New Date(2016, 10, 10).AddHours(8)), New Date(2016, 10, 11).AddHours

(17)).WorkingHours.TotalHours
moTask1.[Set](Tsk.Duration, moProject.GetDuration(dHours, TimeUnitType.Hour))
moTask1.[Set](Tsk.Work, moProject.GetDuration(dHours, TimeUnitType.Hour))

moRes1 = moProject.Resources.Add(“Empl1”)
moAssign1 = moProject.ResourceAssignments.Add(moTask1, moRes1)
moAssign1.[Set](Asn.WorkContour, WorkContourType.Contoured)
'moAssign2.[Set](Asn.WorkContour, WorkContourType.Flat)


For Each oMPSTime As Aspose.Tasks.TimephasedData In moAssign1.TimephasedData
oMPSTime.Value = "PT0H0M0S"
Next
For Each oMPSTime As Aspose.Tasks.TimephasedData In moAssign1.TimephasedData
oMPSTime.Value = “PT8H0M0S”
oMPSTime.TimephasedDataType = TimephasedDataType.AssignmentRemainingWork
Next

moProject.Save(“c:\Simple.mpp”, Saving.SaveFileFormat.MPP)


Stephan

Hi Stephan,


Thank you for writing to Aspose support team.

I have tried to re-produce the issue using WorkContourType.Contoured, WorkContour.Flat and even without setting any work contour type. I am afraid that no issue is observed and need further assistance in this regard. Could you please let us know what strange results are observed in MSP 2010? Please provide us more details through output files and images to identify the problem. It will help us to observe the issue and provide assistance accordingly.

<span style=“color: rgb(0, 0, 0); font-family: “Times New Roman”; font-size: medium; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none;”>Also please make it sure that you are using latest version of Aspose.Tasks for .NET 9.6.0 in your project.

Hi



we are using the latest DLL Version 9.6.0



I create a little mpp file with WorkContourType.Contoured in Task1 and
WorkContourType.Flat in Task2.


Please find the attached Screenshot and mpp file.
Opening this File with MSProject 2010 Task1 is not shown as expected.


Hi Stephan,


I have performed test by setting the WorkConourType.Contoured but used two different template files.

It is observed that if the template file default setting for new tasks is “Manually Scheduled”, then the output of the program is strange as shown in the “Task 1” image sent by you. (Template file name is Blank2010.mpp and output file name is WorkContourType.Contoured.Blank2010.mpp)

On the other hand if another template file whose default setting for new tasks is “Automatically Scheduled” then the resultant task is same as for the WorkContourType.Flat is generated. (Template file name is Blank2010AutoSheduled.mpp and output file name is WorkContourType.Contoured.Blank2010AutoSheduled.mpp.mpp)

You may please try your sample code with the attached template files one by one and share the feedback.