Browse our Products

Aspose.Tasks for .NET 21.10 Release Notes

All Changes

KeySummaryIssue Type
TASKSNET-10378Fix calculation of formula results when operand is #ERROR valueEnhancement
TASKSNET-10376Fix “Value was either too large or too small for a Decimal.” exception when get pages countBug
TASKSNET-10368Fix reading of values of Actual Work’s Timephased DataBug
TASKSNET-10361Fix “File reading error.” exception when open documentBug
TASKSNET-4762Fix rendering of task links in Gantt chart viewBug

Public API and Backwards Incompatible Changes

The following public methods and properties were added:Description
Aspose.Tasks.ExtendedAttribute.IsErrorValueGets whether calculation of extended attribute’s value resulted in an error.
Aspose.Tasks.ViewCollection.GetByViewScreen(Aspose.Tasks.ViewScreen)Searches for a View with the specified Screen property, and returns the first occurrence within the collection.
Aspose.Tasks.ViewCollection.GetByName(System.String)Searches for a View with the name, and returns the first occurrence within the collection.

Examples and additional notes

Related issue: TASKSNET-10378 - Fix calculation of formula results when operand is #ERROR value

Read-only property ExtendedAttribute.IsErrorValue was added to provide an ability to check whether the value of calculated custom atrribute cannot be calculated (due to error in input arguments or an error in the formula).

Project project = new Project();
var attributeDefinitions = ExtendedAttributeDefinition.CreateTaskDefinition(ExtendedAttributeTask.Cost1, "Cost ratio");
attributeDefinitions.Formula = "[Cost] / [Overtime Cost]";
project.ExtendedAttributes.Add(attributeDefinitions);
var task = project.RootTask.Children.Add("Task 1");

var calculatedAttribute = attributeDefinitions.CreateExtendedAttribute();
task.ExtendedAttributes.Add(calculatedAttribute);

task.Set(Tsk.OvertimeCost, 0m);

// Output is "#Error" because Overtime Cost is zero.
Console.WriteLine("Calculated attribute value: {0}", calculatedAttribute.IsErrorValue ? "#Error" : calculatedAttribute.NumericValue.ToString());

task.Set(Tsk.Cost, 123m);
task.Set(Tsk.OvertimeCost, 150m);

Console.WriteLine("Calculated attribute value: {0}", calculatedAttribute.IsErrorValue ? "#Error" : calculatedAttribute.NumericValue.ToString());

New methods for searching Views in ViewCollection

GetByViewScreen and GetByName methods were added to ViewCollection in order to allow searching of Views by Screen and by Name property respectively.

Project project = new Project("Project.mpp");
var taskUsageView = project.Views.GetByViewScreen(ViewScreen.TaskUsage);
var ganttChartView = project.Views.GetByName("&Gantt Chart");