Browse our Products

Aspose.Tasks for Java 21.11 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
com.aspose.tasks.ExtendedAttribute.isErrorValue()Gets whether calculation of extended attribute’s value resulted in an error.
com.aspose.tasks.ViewCollection.getByViewScreen(com.aspose.tasks.ViewScreen)Searches for a View with the specified Screen property, and returns the first occurrence within the collection.
com.aspose.tasks.ViewCollection.getByName(java.lang.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 attribute cannot be calculated (due to error in input arguments or an error in the formula).

Project project = new Project();
ExtendedAttributeDefinition attributeDefinitions = ExtendedAttributeDefinition.createTaskDefinition(ExtendedAttributeTask.Cost1, "Cost ratio");
attributeDefinitions.setFormula("[Cost] / [Overtime Cost]");
project.getExtendedAttributes().add(attributeDefinitions);
Task task = project.getRootTask().getChildren().add("Task 1");

ExtendedAttribute calculatedAttribute = attributeDefinitions.createExtendedAttribute();
task.getExtendedAttributes().add(calculatedAttribute);

task.set(Tsk.OVERTIME_COST, BigDecimal.ZERO);

// Output is "#Error" because Overtime Cost is zero.
System.out.println("Calculated attribute value: " + (calculatedAttribute.isErrorValue() ? "#Error" : calculatedAttribute.getNumericValue()));

task.set(Tsk.COST, BigDecimal.valueOf(123));
task.set(Tsk.OVERTIME_COST, BigDecimal.valueOf(150));

System.out.println("Calculated attribute value: " + (calculatedAttribute.isErrorValue() ? "#Error" : calculatedAttribute.getNumericValue()));

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");
View taskUsageView = project.getViews().getByViewScreen(ViewScreen.TaskUsage);
View ganttChartView = project.getViews().getByName("&Gantt Chart");