Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>your starting point is the following methods on the assignment object:</p> <pre><code>List&lt;TimephasedResourceAssignment&gt; complete = assignment.getTimephasedComplete(); List&lt;TimephasedResourceAssignment&gt; planned= assignment.getTimephasedComplete(); </code></pre> <p>As their names suggest, these will get you either the planned work or the complete work, expressed as work carried out over periods of time.</p> <p>The "gotcha" here is that this data is represented in a compact format (reflecting how it's stored by MS Project internally), and this does not lend itself well to showing a period-by-period breakdown of work.</p> <p>To get what you want, there are two utility classes which will help you to convert this compact representation into a list of work values. For example, you can give them a start date a period type (day, week, month and so on) and a number of periods, and ask for the work to be broken down over these periods.</p> <p>First step is to create an instance of the TimescaleUtility class, and get it to generate a range of dates for you. You give it the start date, the timescale units you require, and the numnber of periods you want.</p> <pre><code>TimescaleUtility timescale = new TimescaleUtility(); ArrayList&lt;DateRange&gt; dateList = timescale.createTimescale(startDate, TimescaleUnits.DAYS, length); </code></pre> <p>The dateList variable now contains the list of date ranges you are going to split the work over. This split is carried out using the TimephasedUtility class:</p> <pre><code>ProjectCalendar calendar = assignment.getCalendar(); TimephasedUtility timephased = new TimephasedUtility(); ArrayList&lt;Duration&gt; durationList = timephased.segmentResourceAssignment(calendar, planned, TimescaleUnits.DAYS, dateList); </code></pre> <p>That's it, your durationList now contains one entry for each entry in the datList showing the amount of work for that period.</p> <p>Hope that makes sense!</p> <p>Jon</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload