Assignment Overtime and Remaining Costs

Handling Overtime, Remaining Costs and Work

The Asn class exposes a number of properties for handling an assignment’s overtime, remaining costs and work:

To see assignment overtime, remaining cost and work in Microsoft Project:

  1. On the Task Usage screen, select the Insert menu, then Column.
  2. Add the desired columns.

Getting Assignment Overtimes in Aspose.Tasks

The following code example demonstrates how to get assignment overtimes, remaining costs and work using Aspose.Tasks.

 1// Create project instance
 2System::SharedPtr<Project> project1 = System::MakeObject<Project>(dataDir + u"ResourceAssignmentOvertimes.mpp");
 3    
 4// Print assignment overtimes
 5    
 6{
 7    auto ra_enumerator = (project1->get_ResourceAssignments())->GetEnumerator();
 8    decltype(ra_enumerator->get_Current()) ra;
 9    while (ra_enumerator->MoveNext() && (ra = ra_enumerator->get_Current(), true))
10    {
11        System::Console::WriteLine(ra->Get<System::Decimal>(Asn::OvertimeCost()));
12        System::Console::WriteLine(System::ObjectExt::ToString(ra->Get<Duration>(Asn::OvertimeWork())));
13        System::Console::WriteLine(ra->Get<System::Decimal>(Asn::RemainingCost()));
14        System::Console::WriteLine(ra->Get<System::Decimal>(Asn::RemainingOvertimeCost()));
15        System::Console::WriteLine(System::ObjectExt::ToString(ra->Get<Duration>(Asn::RemainingOvertimeWork())));
16        System::Console::WriteLine(System::ObjectExt::ToString(ra->Get<Duration>(Asn::RemainingOvertimeWork())));
17    }
18}

Work Completion Percentage

The PercentWorkComplete property exposed by the Asn class is used to manage the percentage of work completed on an assignment.

The following example shows how to get the percentage of work completed on an assignment using Aspose.Tasks.

 1// Create project instance
 2System::SharedPtr<Project> project1 = System::MakeObject<Project>(dataDir + u"ResourceAssignmentPercentWorkComplete.mpp");
 3    
 4// Print assignment percent completion
 5    
 6{
 7    auto ra_enumerator = (project1->get_ResourceAssignments())->GetEnumerator();
 8    decltype(ra_enumerator->get_Current()) ra;
 9    while (ra_enumerator->MoveNext() && (ra = ra_enumerator->get_Current(), true))
10    {
11        System::Console::WriteLine(System::Convert::ToString(ra->Get<int32_t>(Asn::PercentWorkComplete())));
12    }
13}
Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.