TreeGrid v6.4

Gantt resources

TreeGrid documentation index

The resource list is defined globally for whole chart in <Resources> root tag.

The individual resources can be assigned to tasks to compute their price.

The tasks can filtered according to the assigned resources.

TreeGrid provides various calculations for resources and prices.

 

Resources list

 

Resources are defined globally for the whole project in root tag <Resources>, individual resources are defined in nested <R> tags.

 

For example simple definition can be:

<Grid>

                ...

                <Resources>

                               <R Name=’Resource1’ Price=’100’/>

                               <R Name=’Resource2’ Price=’200’/>

                </Resources>

</Grid>

 

<Resources>               <R>                                                                                                                                    new 6.4       .

One resource definition. It can be placed only in root <Resources> tag.

 

<R>                  string    Name                                                                                                                               new 6.4       .

Unique name of the resource.

 

<R>                  string    Text                                                                                                                                  new 6.4       .

Text displayed for the resource in the popup menu for assigning resources to the task.

If not set, the Name is used.

 

<R>                  float      Price                                                                                                                                 new 6.4       .

Price per one resource unit.

The resource units are set by GanttDataUnits.

 

<R>                  float      MaxCount                                                                                                                    new 6.4       .

Maximal summary count of resources assigned to all task in at one time.

 

API variable     object[] Resources                                                                                                                  new 6.4       .

The array of all resources in grid, accessible by its name.

The resource objects contain all the XML attributes like Price or MaxCount.

Example: Grid.Resources.Worker.Price = 150;

 

Resources assign

 

Every task can have assigned one or more resources from global <Resources> list. It can have also specified how many resource units it uses.

 

<C><cell>        string    GanttResources                  Gantt source – column name or exact value                  chg 6.4       .

The resources assigned to the task. It can be column name or string

It is in format:   name1*amount1+extra1;name2*amount2+extra2;...

Resources are separated by semicolon (defined by <Format ValueSeparator/>), the name and amount are separated by asterisk (defined by <Format CountSeparator/>).

The name is resource name.

The amount is amount of resource units per task data unit. The amount can be omitted if it is 1.

The extra is extra price for the resource independent on the task duration. The extra can be omitted if it is 0.

If the name and amount are omitted, the extra is extra price for the task independent on resources and task duration. There should be only such extra price per task.

The GanttResources can be also just plain text to display it next to task, without filtering and pricing functionality.

 

<C>                  int        GanttResourcesAssign            [4]                                                                   new 6.4       .

How the resources can be assigned to the task, affects the menu for assigning resources.

The behavior can be more modified also by GanttResourcesMenu.

0 – Only one resource can be assigned to the task, the menu is clickable. The Extra prices are not shown.

1 – The resources can be assigned only as 0/1, the checkboxes are shown - set Default: { Bool:1 }

2 – The resources can be assigned as 0 – 10, the enums are shown – set Default: { Enum:1, Width:22, Items:["","1","2","3","4","5","6","7","8","9","10"] }

3 – The resources can be assigned as integers, the edits are shown – set Default: { Edit:1, Width:40, Type:”Int”, Size:5 }

4 – The resources can be assigned as floats, the edits are shown –

set Default: { Edit:1, Width:60, Type:”Float”, Format:"0.##;;", DisplayFormat:"0.00;;", EditMask:"^\\d{0,5}(\\.\\d{0,2})?$"}

5 – Only extra prices permitted by GanttResourcesExtra are shown.

 

<C>                  int        GanttResourcesExtra                [0]                                                                   new 6.4       .

If and how will be possible to add extra prices to tasks when editing resources from menu.

0 – no extra price possible.

1 – one extra price per whole task

2 – one extra price per one resource

3 – both extra prices per task and per resource

 

<C><cell>        string    GanttResourcesMenu                                                                                       new 6.4       .

Optional menu to assign the resources to the task. Here is possible to specify which resources and how can be assigned to the individual task.

It is standard TreeGrid menu.

The items must be named (Name attribute) as resource names to be correctly assigned.

The Name of the extra task price item must be “Extra”, the names of extra resource prices must be name+”Extra”

 

Resources filter

The tasks can be easily filtered according to assigned resources.

User interface for filtering by resources can be added to grid by cell Type=’SelectGanttResources’

 

<Space cell>    string    Type           Type=”SelectGanttResources”                                                  new 6.3       .

Special combo box to choose resources to display in grid. It hides all rows that do not contain any selected resources

It presets these cell attribute: Type=”Html” Button=”Defaults” Defaults= "|*None|-|*RowsVariableCol"+resource col+"*"

OnChange= "Grid.FilterTextRange('"+ resource col +"',Value);" Range=”1”

 

Resources calculations

 

API method     float      GetGanttPrice            (TRow row, string col, int bar = null)                                         new 6.4       .

Returns price of the bar according to its duration and assigned resources

If bar is null uses bar according to the GanttDependencyObjects. Otherwise bar is 1 for main bar, 2 for flow and 3 for run.

In Formula it can be called as Grid.GetGanttPrice(Row,”XXX”) where XXX is Gantt column name.

 

API method     object[][] GetGanttResourcesUsage   (string def, TRow row, string col, string units, int bar, bool notmp)      new 6.4 .

Returns all resource usage per unit in two dimensional array.

The array contain resource usage object by resource name.

The resource usage array contain count of resource per one units, starting from 0 as the first unit displayed in the chart.

The array contains only work time, all holidays are excluded.

All parameters can be null.

def – name of default row (Def attribute). Only variable rows with this default will be iterated. If not set, all variable rows are iterated.

row – if set, it iterates only children (and their children) of the row.

col – gantt column to use, if not set, the first gantt column in grid will be used

units – data units to create the list for, the same values as GanttDataUnits. If not set, the GanttDataUnits will be used.

bar - 1 for main bar, 2 for flow and 3 for run. If not set, uses bar according to the GanttDependencyObjects.

notmp – if not set, the functions iterates the grid only once per grid calculating (calling Calculate/Recalculate). It means that two calls in one calculating return the same object. If set notmp, the list is always created new.

 

API method     float GetGanttResourceCount             (string res, int start, int end, int type, string col, string def)      new 6.4 .

Returns information about the resource res usage between dates start and end.

The start and end can be Date object, number of milliseconds or date string in English.

def – name of default row (Def attribute). Only variable rows with this default will be iterated. If not set, all variable rows are iterated.

col – gantt column to use, if not set, the first gantt column in grid will be used

type = 0 – returns Total – Sum of all resource units used in the range

type = 1 – returns Peak – Maximum count of the resource in the range at the same time.

type = 2 – returns Average – Average usage of the resource in the range

 

formula            float      ganttresourcepeak           (string resource, string def)                                          new 6.4       .

Returns maximal count of the resource used in grid at one time

resource is Name of the resource.

def is name of default row (Def attribute). Only variable rows with this default will be iterated. If not set, all variable rows are iterated.

 

formula            float      ganttresourceunits           (string resource, string def)                                          new 6.4       .

Returns count of all allocated units for given resource in the whole grid.

If the value is multiplied by resource price, you will get the summary cost of the resource in the project

def is name of default row (Def attribute). Only variable rows with this default will be iterated. If not set, all variable rows are iterated.

 

formula            float      ganttresourceextra           (string resource, string def)                                          new 6.4       .

Returns summary of extra prices assigned to tasks for given resource (the price after + in GanttResources).

def is name of default row (Def attribute). Only variable rows with this default will be iterated. If not set, all variable rows are iterated.

 

Resource usage chart

 

The usage of individual resource in grid can be shown in row in gantt Chart object of type “Resources”.

Set attribute GanttChart=”Resources”.

The resources usage chart can be combined also with other Gantt objects.

 

<C><cell>        string    GanttChart                    GanttChart = “Resources”                                                         new 6.4       .

Shows the resource usage chart in the Gantt cell

 

<C><cell>        string    GanttChartResource                                                                                           new 6.4       .

Name of the resource to show in the resource usage chart.

 

<C><cell>        string    GanttChartResourceDef                                                                                  new 6.4       .

If set, only rows with the given default name (Def attribute) are iterated for the resource usage.

 

<C><cell>        string    GanttChartResourceFormat                                                                         new 6.4       .

Format of the number shown in the resource chart.

The same as TreeGrid number format.

 

Automatically generated resource usage chart

 

The resource usage chart can be automatically generated from another (even invisible) grid.

The resources list can be modified, the resources can be added, deleted, changed or renamed.

 

There are must be two grids on page, master and detail.

 

Detail grid is the grid displaying the resources usage chart.

It should have defined only layout XML source.

The body rows are automatically generated from master’s <Resources> list. This way is defined by detail’s attributes <Cfg GanttResources... /> attributes.

The detail grid can contain Gantt column to show the resources usage from the master grid. Use the attributes for Resources usage chart.

The detail’s Gantt column reads these attributes from master’s Gantt column:

DataUnits,EndLast,Exclude,Include,MaxExclude,HeaderTrim,Background,Zoom,SmoothZoom,ZoomList,Width,Units and the <Zoom> tag

Changes in the resources list should be uploaded from detail grid as normal changes in data rows.

 

Master grid is the source grid.

The master grid must contain standard Gantt chart with tasks with assigned resources and global resources list in <Resources>.

The master’s <Resources> list is automatically updated after any change (add, deleted, modify, rename) in the detail grid.

The master grid be displayed and recalculated according to the changes in resources.

The resources assigned to tasks are not automatically changed after resource is renamed or deleted and should be done manually in some API event.

Or the master grid can be hidden (<treegrid Hidden=’1’) and used only as resources list source

 

<Cfg>               string    GanttResourcesMaster                                                                                   new 6.4       .

Base attribute in automatically generated resource usage chart.

Specifies id of the master grid from where this detail grid’s resource chart will be calculated.

 

<Cfg>               string    GanttResourcesName               [“Name”]                                                          new 6.4       .

Name of column in detail grid where the resource Name will be displayed and edited

 

<Cfg>               string    GanttResourcesPrice                 [“Price”]                                                           new 6.4       .

Name of column in detail grid where the resource Price will be displayed and edited

 

<Cfg>               string    GanttResourcesMaxCount    [“MaxCount”]                                                    new 6.4       .

Name of column in detail grid where the resource MaxCount will be displayed and edited

 

<Cfg>               string    GanttResourcesGantt    [first Gantt column in master grid]                                 new 6.4       .

The Gantt column in master grid where to read the resources usage (this attribute is still set in detail grid).

 

<Cfg>               string    GanttResourcesChart    [first Gantt column in detail grid]                                   new 6.4       .

The Gantt column in detail grid where to display the resources chart

 

<treegrid,bdo> bool     Hidden      [0]                                                                                                                  new 6.4       .

If set to 1 the grid is never rendered and can be used as invisible data source for other grids or other page components.

The hidden grid has not set MainTag and cannot be shown at all.

It can be set in master grid to use it just as date source.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

.