Aspose.Tasks for .NET 21.4 Release Notes

All Changes

KeySummaryIssue Type
TASKSNET-4788Add support for SaveOptions.TaskFilter and SaveOptions.TasksComparer options when project is saved to CSV or XLSX formatsEnhancement
TASKSNET-4769Remove an ability to set Tsk.Id when using CalculationMode.Manual and CalculationMode.AutomaticEnhancement
TASKSNET-4793Fix exported value of “Outline Code *” attributes when project is saved to non-MPP formats.Bug
TASKSNET-4792Fix headers in exported XLSX when custom ProjectView is specified.Bug
TASKSNET-4772Fix parsing of “Round” operator in formulasBug
TASKSNET-4770Fix wrong calendar exception usageBug
TASKSNET-4751Fix OverflowException while reading MPP fileBug
TASKSNET-4749Fix tasks splitting in case of splits beginning \ ending in middle of the day.Bug
TASKSNET-4746Fix chart rendering to take chart position into accountBug
TASKSNET-4697Fix incorrect ids of task childrenBug
TASKSNET-4695Fix incorrect resource unit price while converting to CSVBug
TASKSNET-4694Fix incorrect unit of work time in 2010 and 2007 formats while exporting to CSVBug
TASKSNET-4693Fix task splitting in MPP export not working as expectedBug
TASKSNET-4374Fix file resaved with Aspose.Tasks cannot be opened by MSP 2016Bug

Public API and Backwards Incompatible Changes

The following public methods and properties were deleted:Description

Examples and additional notes

Related issue: TASKSNET-4769 - Remove an ability to set Tsk.Id when using CalculationMode.Manual and CalculationMode.Automatic.

The logic for Tsk.Id field was changed: it can no longer be set directly and is calculated by Aspose.Tasks (in the same manner as MS Project doesn’t allow “Id” column to be set). The above is true for CalculationMode.Manual and CalculationMode.Automatic modes.

You can use CalculationMode.None to set the value Tsk.Id on your own risk, but these values can overwritten when project is recalculated (see the example).

Project project = new Project();
var task = project.RootTask.Children.Add("task 1");
// task.Set(Tsk.Id, 100); // Throws System.InvalidOperationException in Aspose.Tasks for .NET 21.4.
project.CalculationMode = CalculationMode.None;
task.Set(Tsk.Id, 100);
Console.WriteLine(task.Get(Tsk.Id)); // Outputs 100
project.CalculationMode = CalculationMode.Automatic;
Console.WriteLine(task.Get(Tsk.Id)); // Outputs 1

It’s also worth reminding that Tsk.Id cannot be used as a stable identifier of a task because its value can be recalculated when tasks tree is changed. Field Tsk.Uid (corresponds to MS Project’s ‘Unique ID’ field) can be used as a stable identifier instead. Consider the following example:

var project = new Project();
var task1 = project.RootTask.Children.Add("Task 1");
var task2 = project.RootTask.Children.Add("Task 2");
var task3 = project.RootTask.Children.Add("Task 3");

Console.WriteLine("Task1.Id: {0}", task1.Get(Tsk.Id));
Console.WriteLine("Task2.Id: {0}", task2.Get(Tsk.Id));
Console.WriteLine("Task3.Id: {0}", task3.Get(Tsk.Id));

var task11 = task1.Children.Add("Task 11");

Console.WriteLine("Task1.Id: {0}", task1.Get(Tsk.Id));
Console.WriteLine("Task11.Id: {0}", task11.Get(Tsk.Id));
Console.WriteLine("Task2.Id: {0}", task2.Get(Tsk.Id));
Console.WriteLine("Task3.Id: {0}", task3.Get(Tsk.Id));

The output is

Task1.Id: 1
Task2.Id: 2
Task3.Id: 3

Task1.Id: 1
Task11.Id: 2
Task2.Id: 3
Task3.Id: 4

Thus the values of ‘Id’ field of task2 and task3 were changed after new task is inserted.