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

How to write the OutlineLevel using CalcTaskxx

If I call CalcTaskIds and CalcTaskUids after setting the Task.OutLineLevel.Property value, the value is set to “1”.
This problem was treated in a old post (<a href="https://forum.aspose.com/t/4858#576371)

• So, how do I set the outlinelevel? There are more than 2 levels!

taskMSP.Duration = New TimeSpan(0, 0, 1)
Else
End If
End If

'Not baseline???
End If

Loop

Hi Katherine,

Please spare us little time as we are working on this issue and will share our feedback soon.

Hi Katherine,

I have analyzed your requirements and code and following are the suggestions:

1. For a task, Start Date and Duration are sufficient as Finish date is automatically calculated. Therefore it is suggested that just provide task start date and duration.
2. Constraints should be applied wherever required like if you want to start particular task on a defined date, use ConstraintType.StartNoEarlierThan and provide constraint date as well.

Following is a sample code which creates project with multiple tasks and upto OutlineLevel 4. Could you please give it a try and let us know your feedback? Output of the code can be viewed here: http://prntscr.com/4sjstu.

{
Project prj = new Project();

t1.Start = new DateTime(2014,10,6);
t1.Duration = new TimeSpan(16,0,0);
t1.OutlineLevel = 1;
t1.ConstraintType = ConstraintType.StartNoEarlierThan;
t1.ConstraintDate = t1.Start;
t1.DurationFormat = TimeUnitType.Day;

t2.Start = new DateTime(2014, 10, 6);
t2.Duration = new TimeSpan(16, 0, 0);
t2.OutlineLevel = 2;
t2.ConstraintType = ConstraintType.StartNoEarlierThan;
t2.ConstraintDate = t2.Start;
t2.DurationFormat = TimeUnitType.Day;

t3.Start = new DateTime(2014, 10, 7);
t3.Duration = new TimeSpan(8, 0, 0);
t3.OutlineLevel = 2;
t3.ConstraintType = ConstraintType.StartNoEarlierThan;
t3.ConstraintDate = t3.Start;
t3.DurationFormat = TimeUnitType.Day;
``````  Aspose.Tasks.Task t4 = <span class="kwrd">new</span> Aspose.Tasks.Task();<br>      t4.Name = "SummaryTask3To6";<br>      t4.Start = <span class="kwrd">new</span> DateTime(2014, 10, 8);<br>      t4.Duration = <span class="kwrd">new</span> TimeSpan(8, 0, 0);<br>      t4.OutlineLevel = 1;<br>      t4.ConstraintType = ConstraintType.StartNoEarlierThan;<br>      t4.ConstraintDate = t4.Start;<br>      t4.DurationFormat = TimeUnitType.Day;<br>      prj.RootTask.Children.Add(t4);<br>
``````

t5.Start = new DateTime(2014, 10, 8);
t5.Duration = new TimeSpan(8, 0, 0);
t5.OutlineLevel = 2;
t5.ConstraintType = ConstraintType.StartNoEarlierThan;
t5.ConstraintDate = t5.Start;
t5.DurationFormat = TimeUnitType.Day;

t6.Start = new DateTime(2014, 10, 9);
t6.Duration = new TimeSpan(80, 0, 0);
t6.OutlineLevel = 2;
t6.ConstraintType = ConstraintType.StartNoEarlierThan;
t6.ConstraintDate = t6.Start;
t6.DurationFormat = TimeUnitType.Day;

t7.Start = new DateTime(2014, 10, 9);
t7.Duration = new TimeSpan(24, 0, 0);
t7.OutlineLevel = 2;
t7.ConstraintType = ConstraintType.StartNoEarlierThan;
t7.ConstraintDate = t6.Start;
t7.DurationFormat = TimeUnitType.Day;

t8.Start = new DateTime(2014, 10, 15);
t8.Duration = new TimeSpan(48, 0, 0);
t8.OutlineLevel = 3;
t8.ConstraintType = ConstraintType.StartNoEarlierThan;
t8.ConstraintDate = t8.Start;
t8.DurationFormat = TimeUnitType.Day;

t9.Start = new DateTime(2014, 10, 21);
t9.Duration = new TimeSpan(16, 0, 0);
t9.OutlineLevel = 4;
t9.ConstraintType = ConstraintType.StartNoEarlierThan;
t9.ConstraintDate = t9.Start;
t9.DurationFormat = TimeUnitType.Day;

t10.Start = new DateTime(2014, 10, 14);
t10.Duration = new TimeSpan(32, 0, 0);
t10.OutlineLevel = 1;
t10.ConstraintType = ConstraintType.StartNoEarlierThan;
t10.ConstraintDate = t10.Start;
t10.DurationFormat = TimeUnitType.Day;

t11.Start = new DateTime(2014, 10, 27);
t11.Duration = new TimeSpan(16, 0, 0);
t11.OutlineLevel = 1;
t11.ConstraintType = ConstraintType.StartNoEarlierThan;
t11.ConstraintDate = t11.Start;
t11.DurationFormat = TimeUnitType.Day;

t12.Start = new DateTime(2014, 10, 13);
t12.Duration = new TimeSpan(24, 0, 0);
t12.OutlineLevel = 1;
t12.ConstraintType = ConstraintType.StartNoEarlierThan;
t12.ConstraintDate = t12.Start;
t12.DurationFormat = TimeUnitType.Day;