Aspose.Tasks for C++ 23.10 Release Notes

Long-style includes

Since 23.8, Aspose.Tasks for C++ uses long-style includes to prevent header name clashing. Please refer to Aspose.Tasks for C++ 23.8 release notes to learn how to switch your project to use long-style includes. We’ll continue the short-style includes support until January, 2024, inclusive.

All Changes

KeySummaryIssue Type
TASKSNET-11003Add validation which ensures that Project.Calendar points to calendar belonging to Project.Calendars collectionEnhancement
TASKSNET-11002Add public API to allow passing of encoding when reading Primavera XER filesEnhancement
TASKSNET-10971Modify hierarchy of Save Options to remove members of SaveOptions not applicable to certain formatsEnhancement
TASKSNET-10815Add reading of baseline projects for Primavera XML formatEnhancement

Public API and Backwards Incompatible Changes

The following public types were added:Description
Aspose.Tasks.Saving.SimpleSaveOptionsThis is an abstract base class that allow the user to specify basic options when saving a project into a particular format.
The following public methods and properties were added:Description
Aspose.Tasks.LoadOptions.EncodingGets or sets encoding which is used to read a project from HTML, MPX, XER and Primavera XML formats.
Aspose.Tasks.PrimaveraProjectProperties.CurrentBaselineProjectIdGets Id of the current baseline project.
Aspose.Tasks.PrimaveraProjectProperties.BaselineProjectsGets array of baseline projects of current project.
Aspose.Tasks.PrimaveraReadOptions.ReadBaselineProjectsGets or sets a flag that specifies whether baseline projects should be loaded. The default value is true.
Aspose.Tasks.PrimaveraTaskProperties.BudgetedLaborCostGets the value of budgeted (or planned) labor cost .
Aspose.Tasks.PrimaveraTaskProperties.BudgetedNonlaborCostGets the value of budgeted (or planned) non labor cost .
Aspose.Tasks.PrimaveraTaskProperties.BudgetedMaterialCostGets the value of of budgeted (or planned) material cost.
Aspose.Tasks.PrimaveraTaskProperties.BudgetedExpenseCostGets the value of budgeted (or planned) expense cost.
Aspose.Tasks.PrimaveraTaskProperties.BudgetedTotalCostGets the total value of budgeted (or planned) costs.
Aspose.Tasks.Project.Save(System.String,Aspose.Tasks.Saving.SimpleSaveOptions)Saves the document to a file using the specified save options.
Aspose.Tasks.Project.Save(System.IO.Stream,Aspose.Tasks.Saving.SimpleSaveOptions)Saves the project to a stream using the specified save options.
Aspose.Tasks.Saving.CsvOptions.ViewGets or sets a list of the view columns () to save to XLSX format.
Aspose.Tasks.Saving.SimpleSaveOptions.SaveFormatGets or sets the format in which the document will be saved if this save options object is used.
Aspose.Tasks.Saving.SimpleSaveOptions.TasksComparerGets or sets the comparer to sort tasks on Gantt chart and Task Sheet chart.
Aspose.Tasks.Saving.SimpleSaveOptions.TasksFilterGets or sets the condition which is used to filter tasks rendered on Gantt, Task Sheet and Task Usage charts.
Aspose.Tasks.Saving.Spreadsheet2003SaveOptions.ViewGets or sets a list of the view columns () to save.
Aspose.Tasks.Saving.XlsxOptions.ViewGets or sets a list of the view columns () to save to XLSX format.
The following public methods and properties were deleted:Description
The following public enumerations were deleted:Description

Examples and additional notes

Related issue: TASKSNET-11002 - Add public API to allow passing of encoding when reading Primavera XER files.

Starting with 23.10 encoding of input file can be set using LoadOptions.Encoding property:

auto loadOptions = System::MakeObject<LoadOptions>();
auto project = System::MakeObject<Project>(u"encoding1251.xer", loadOptions);

Related issue: TASKSNET-10971 - Modify hierarchy of Save Options to remove members of SaveOptions not applicable to certain formats.

Prior to version 23.10, all save options classes were inheritors of SaveOptions, which contained properties related to views that are not applicable to certain formats. For example Timescale or UseGradientBrush properties do not make sense when saving a project to Excel or MPX format.

To address this issue, a new base class for save options was intoduced: SimpleSaveOptions. The following save options classes are now inherited from SimpleSaveOptions: CsvOptions, MPPSaveOptions, PrimaveraSaveOptions, PrimaveraXmlSaveOptions, Spreadsheet2003SaveOptions, XlsxOptions. The following save options classes are still inherited from SaveOptions: HtmlSaveOptions, ImageSaveOptions, PdfSaveOptions, SvgOptions, XamlOptions, XpsOptions because these formats involve rendering and saving a project’s view to the output file.

Related issue: TASKSNET-10815 - Add reading of baseline projects for Primavera XML format.

The following applies to projects read from Primavera XML format (Primavera XER format doesn’t support baselines). While Microsoft Project allows 1-10 baselines and only has a limited number of baseline properties, Primavera allows an unlimited number of baseline projects, which are full snapshots of the original project. Starting with version 23.10, the baseline project can be examined using the PrimaveraProperties.BaselineProjects property:

System::SharedPtr<Task> GetTaskByActivityId(System::SharedPtr<Project> baselineProject, System::String activityId)
    for (auto&& task : System::IterateOver(baselineProject->EnumerateAllChildTasks()))
        if (task->get_ActivityId() == activityId) return task;
    return nullptr;

void main()
    System::SharedPtr<Project> project = System::MakeObject<Project>(System::String(u"BaselineProjects.xml"));    
    System::Console::WriteLine(System::String(u"Current baseline project uid: ") + project->get_PrimaveraProperties()->get_CurrentBaselineProjectId());    
    for (System::SharedPtr<Project> baselineProject : project->get_PrimaveraProperties()->get_BaselineProjects())
        System::Console::WriteLine(u"Baseline project: uid: {0}, name: '{1}'", baselineProject->get_Uid(), baselineProject->get_Name());
    auto baseline1 = project->get_PrimaveraProperties()->get_BaselineProjects()[1];
    auto task = GetTaskByActivityId(project, u"A1000");
    auto baselineTask = GetTaskByActivityId(baseline1, u"A1000");
    System::Console::WriteLine(u"Task budgeted total cost: {0}", task->get_PrimaveraProperties()->get_BudgetedTotalCost());
    System::Console::WriteLine(u"Task baseline budgeted total cost: {0}", baselineTask->get_PrimaveraProperties()->get_BudgetedTotalCost());