Browse our Products

Aspose.Tasks for C++ 21.2 Release Notes

CLang support

Since version 21.2, the release also includes a ELF shared library built with CLang-3.9. Since the size of the full distribution becomes quite large, platform-specific packages are now available for download. They contain separate binaries for Windows and for Linux, respectively.

All Changes

KeySummaryIssue Type
TASKSNET-4642Add support for user-defined page size when saving project to graphical formatEnhancement
TASKSNET-4636Improve rendering of Gantt view page legend to use “adaptive” items layoutEnhancement
TASKSNET-4635Add handling of “AADSTS53003: Access has been blocked by Conditional Access policies.
The access policy does not allow token issuance.” error and return clear message to the user
Enhancement
TASKSNET-4632Fix Actual Duration while setting Actual Finish date of the taskEnhancement
TASKSNET-4467Improve support of XML baseline for MSP 2019Enhancement
TASKSNET-3585Add support of “RenderToSinglePage” option to TaskUsage, ResourceUsage,
TaskSheet and ResourceSheet views
Enhancement
TASKSNET-4668Fix recalculation of projects with external linksBug
TASKSNET-4667Fix ArgumentOutOfRangeException while recalculate a projectBug
TASKSNET-4666Fix NullReferenceException while recalculate the projectBug
TASKSNET-4644Fix XerPrimaveraReader to construct project with non broken integrityBug
TASKSNET-4640Fix System.OverflowException when trying to save password-protected project twiceBug
TASKSNET-4611Fix exception when opening specific password protected MPPBug
TASKSNET-4608Portrait/Landscape orientation setting ignored when printing / saving to PDFBug
TASKSNET-4604Fix current timescale position is reset when the project is saved by Aspose.TasksBug
TASKSNET-4410Content of a resource’s notes is not shown in MS ProjectBug
TASKSNET-4051Fix calculating of duration while convert MPP formatBug

Public API and Backwards Incompatible Changes

The following public methods and properties were added:Description
Aspose.Tasks.Saving.SaveOptions.CustomPageSizeGets or sets the custom page size in points (1 point = 1/72 of inch).
Aspose.Tasks.Saving.SaveOptions.RenderToSinglePageGets or sets a value indicating whether image should be rendered to a single page. Currently is supported for Gantt chart view.
Aspose.Tasks.Visualization.PageSettings.PaperSizeIdGets or sets an integer representing one of the PrinterPaperSize values or a custom page size id.
The following public enumerations were added:Description
Aspose.Tasks.Visualization.PageSize.DefinedInViewUse page size defined in View’s (View.PageInfo.PageSettings).
Aspose.Tasks.Visualization.PrinterPaperSize.CustomIndicates that the paper size is defined by the user.
Aspose.Tasks.Visualization.PrinterPaperSize.PaperLetterSmallIndicates Small Letter printer paper size (8.5 in. by 11 in.).
Aspose.Tasks.Visualization.PrinterPaperSize.PaperLedgerIndicates Ledger printer paper size (17 in. by 11 in.).
Aspose.Tasks.Visualization.PrinterPaperSize.PaperStatementIndicates Statement printer paper size (5.5 in. by 8.5 in.).
Aspose.Tasks.Visualization.PrinterPaperSize.PaperA4SmallIndicates Small A4 printer paper size (210 mm by 297 mm).
Aspose.Tasks.Visualization.PrinterPaperSize.PaperA5Indicates A5 printer paper size (148 mm by 210 mm).
Aspose.Tasks.Visualization.PrinterPaperSize.PaperFolioIndicates Folio printer paper size (8.5 in. by 13 in.).
Aspose.Tasks.Visualization.PrinterPaperSize.PaperQuartoIndicates Quarto printer paper size (215 mm by 275 mm).
Aspose.Tasks.Visualization.PrinterPaperSize.PaperStandard10x14Indicates Standard printer paper size (10 in. by 14 in.).
Aspose.Tasks.Visualization.PrinterPaperSize.PaperStandard11x17Indicates Standard printer paper size (11 in. by 17 in.).
Aspose.Tasks.Visualization.PrinterPaperSize.PaperNoteIndicates Note printer paper size (8.5 in. by 11 in.).
Aspose.Tasks.Visualization.PrinterPaperSize.PaperCSheetIndicates C paper printer paper size (17 in. by 22 in.).
Aspose.Tasks.Visualization.PrinterPaperSize.PaperDSheetIndicates D paper printer paper size (22 in. by 34 in.).
Aspose.Tasks.Visualization.PrinterPaperSize.PaperESheetIndicates E paper printer paper size (34 in. by 44 in.).
Aspose.Tasks.Visualization.PrinterPaperSize.PaperStandard9x11Indicates Standard printer paper size (9 in. by 11 in.).
Aspose.Tasks.Visualization.PrinterPaperSize.PaperStandard10x11Indicates Standard printer paper size (10 in. by 11 in.).
Aspose.Tasks.Visualization.PrinterPaperSize.PaperStandard15x11Indicates Standard printer paper size (15 in. by 11 in.).
Aspose.Tasks.Visualization.PrinterPaperSize.PaperA2Indicates A2 printer paper size (420 mm by 594 mm).

Examples

Related issue: TASKSNET-4642 - Add support for user-defined page size when saving a project to a graphical format

SaveOptions.CustomPageSize property added so the user can specify custom page size when saving a project to graphical formats.

System::SharedPtr<Project> project = System::MakeObject<Project>(System::String(u"test.mpp"));

System::SharedPtr<ImageSaveOptions> saveOptions = System::MakeObject<ImageSaveOptions>(Aspose::Tasks::Saving::SaveFileFormat::PNG);
saveOptions->set_SaveToSeparateFiles(true);
saveOptions->set_Timescale(Aspose::Tasks::Visualization::Timescale::DefinedInView);
saveOptions->set_CustomPageSize(System::Drawing::SizeF(1224.0f, 340.0f));
saveOptions->set_StartDate(System::DateTime(2012, 12, 22));
saveOptions->set_EndDate(System::DateTime(2013, 5, 10));
saveOptions->set_PresentationFormat(Aspose::Tasks::Visualization::PresentationFormat::ResourceUsage);

project->Save(u"output.png", saveOptions);

Related issue: TASKSNET-3585 - Add support of “RenderToSinglePage” option to TaskUsage, ResourceUsage, TaskSheet and ResourceSheet views

Now SaveOptions.RenderToSinglePage property can be used to specify that the project should be rendered to single page document. In this case the size of the page is adjusted to fit project on one page. SaveOptions.RenderToSinglePage flag is applicable when project is saved to PDF or graphical formats.

System::SharedPtr<Project> project = System::MakeObject<Project>(System::String(u"test.mpp"));

System::SharedPtr<PdfSaveOptions> saveOptions = System::MakeObject<PdfSaveOptions>();
saveOptions->set_Timescale(Aspose::Tasks::Visualization::Timescale::DefinedInView);
saveOptions->set_RenderToSinglePage(true);
saveOptions->set_StartDate(System::DateTime(2012, 12, 22));
saveOptions->set_EndDate(System::DateTime(2013, 5, 10));
saveOptions->set_PresentationFormat(Aspose::Tasks::Visualization::PresentationFormat::TaskUsage);

project->Save(u"output.pdf", saveOptions);
System::SharedPtr<Project> project = System::MakeObject<Project>(System::String(u"TestProject.mpp"));

System::SharedPtr<ImageSaveOptions> saveOptions = System::MakeObject<ImageSaveOptions>(Aspose::Tasks::Saving::SaveFileFormat::PNG);
saveOptions->set_Timescale(Aspose::Tasks::Visualization::Timescale::DefinedInView);
saveOptions->set_RenderToSinglePage(true);
saveOptions->set_StartDate(System::DateTime(2012, 12, 22));
saveOptions->set_EndDate(System::DateTime(2013, 5, 10));
saveOptions->set_PresentationFormat(Aspose::Tasks::Visualization::PresentationFormat::TaskUsage);
saveOptions->set_HorizontalResolution(300);
saveOptions->set_VerticalResolution(300);

project->Save(u"output.png", saveOptions);

Related issue: TASKSNET-4608 - Portrait/Landscape orientation setting ignored when printing / saving to pdf

Added PageSize.DefinedInView enum value so the user can specify that the project should be rendered using page size and page orientation settings defined in view’s settings. These settings can be changed using “Page Setup” dialog of Microsoft Project.

System::SharedPtr<Project> project = System::MakeObject<Project>(System::String(u"test.mpp"));

auto view = project->get_Views()->LINQ_First(static_cast<System::Func<System::SharedPtr<View>, bool>>(static_cast<std::function<bool(System::SharedPtr<View> v)>>([](System::SharedPtr<View> v) -> bool
{
  return v->get_Screen() == Aspose::Tasks::ViewScreen::Gantt;
})));
System::Console::WriteLine(System::String(u"Page size specified in view settings: ") + System::ObjectExt::ToString(view->get_PageInfo()->get_PageSettings()->get_PaperSize()));
System::Console::WriteLine(u"Page orientation: {0}", view->get_PageInfo()->get_PageSettings()->get_IsPortrait() ? System::String(u"Portrait") : System::String(u"Landscape"));

System::SharedPtr<ImageSaveOptions> saveOptions = System::MakeObject<ImageSaveOptions>(Aspose::Tasks::Saving::SaveFileFormat::PNG);
saveOptions->set_SaveToSeparateFiles(true);
saveOptions->set_PageSize(Aspose::Tasks::Visualization::PageSize::DefinedInView);
saveOptions->set_Timescale(Aspose::Tasks::Visualization::Timescale::DefinedInView);
saveOptions->set_StartDate(System::DateTime(2012, 12, 22));
saveOptions->set_EndDate(System::DateTime(2013, 5, 10));
saveOptions->set_PresentationFormat(Aspose::Tasks::Visualization::PresentationFormat::GanttChart);

project->Save(u"output.png", saveOptions);