How to understand OutlineLevel ?
list like:
1 task1
1.1 task2
1.2 task3
2 task4
2.1 task5
2.1.1 task6
IList taskList = ModelConvertHelper.ConvertToModel(dataTable);
for (int i = 0; i < taskList.Count; i++)
{
Task task = null;
task = project.RootTask.Children.Add(epmname);
task.Set(Tsk.Start, new DateTime(start_year, start_month, start_day));
task.Set(Tsk.Finish, new DateTime(end_year, end_month, end_day));
task.Set(Tsk.OutlineLevel, ??);
}
thanks
@yiyibaba,
Thank you for contacting Aspose support team.
OutlineIndent and OutlineOutdent functions shall be used to Indent and Outdent a task. Please give a try to the following sample code which creates the same output as desired above.
Project proj = new Project();
Task Task1 = proj.RootTask.Children.Add("Task 1");
proj.RootTask.Children.Add("Task 2").OutlineIndent();
proj.RootTask.Children.Add("Task 3").OutlineIndent();
proj.RootTask.Children.Add("Task 4");
proj.RootTask.Children.Add("Task 5").OutlineIndent();
var task6 = proj.RootTask.Children.Add("Task 6");
task6.OutlineIndent();
task6.OutlineIndent();
proj.Save(@".\Tasks_164982\output.xml", SaveFileFormat.XML);
Thank you for your quick response~