Working with Resource Overtimes

The Resource class exposes a number of properties for managing resource overtime:

  • Overtime represents the overtime rate (decimal).
  • OvertimeRate represents the overtime rate from the current date, if a rate table exists for the resource (decimal).
  • OvertimeRateFormat represents the units used for the overtime rate (RateFormatType).
  • OvertimeCost represents the sum of an actual and remaining overtime cost (decimal).
  • OvertimeWork represents the amount of overtime work scheduled for tasks (TimeSpan).

Working with Resource Overtimes

To see overtime cost, overtime rate and overtime work in Microsoft Project:

  1. On the Resource sheet, select the Insert menu, and then select Column.
  2. Add the columns.

Getting Resource Overtimes in Aspose.Tasks

The following code example demonstrates how to get resource overtimes using Aspose.Tasks.

 1// Create project instance
 2System::SharedPtr<Project> project1 = System::MakeObject<Project>(dataDir + u"ResourceOvertime.mpp");
 3    
 4// Display overtime related parameters for all resources
 5    
 6{
 7    auto res_enumerator = (project1->get_Resources())->GetEnumerator();
 8    decltype(res_enumerator->get_Current()) res;
 9    while (res_enumerator->MoveNext() && (res = res_enumerator->get_Current(), true))
10    {
11        if (res->Get<System::String>(Rsc::Name()) != nullptr)
12        {
13            System::Console::WriteLine(res->Get<System::Decimal>(Rsc::OvertimeCost()));
14            System::Console::WriteLine(System::ObjectExt::ToString(res->Get<Duration>(Rsc::OvertimeWork())));
15            System::Console::WriteLine(System::ObjectExt::ToString(res->Get<RateFormatType>(Rsc::OvertimeRateFormat())));
16        }
17    }
18}
Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.