# Element tree structure

The Item Tree is used to display all available Item properties within a project/subproject. It is created from the project template and contains all item properties, including custom fields.

<figure><img src="http://aquawiki.andagon.com/pictures/drex_element_tree_structure_1_custom.png" alt=""><figcaption><p>Field tree view</p></figcaption></figure>

Within the hierarchical data structure tree there are lists, fields and calculated fields. For each list within the hierarchical structure, a band can be defined to iterate through its elements. Direct use of a sub-list in a band will only return its top element as it does not automatically iterate through the list and is therefore not recommended.

Calculated fields are fields that return a value based on a customisable function. For example, a custom field might return 1 if a test was passed and 0 if it was not. This practice allows you to count all passed tests, which otherwise would require a lot of scripting.

### <mark style="color:blue;">**Related Elements**</mark> <a href="#related_elements" id="related_elements"></a>

The Dependencies view of an element shows all related elements. For example, related elements of a test scenario are the test cases it contains. You can access this information and iterate through the related elements in the report designer. If you want to use related elements, make sure they are loaded into your report during execution.

<figure><img src="https://3920520305-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyZbW8vbNs5hz8x57emJJ%2Fuploads%2FeHXoTFSeUALNPV2F9Wxc%2FReporting_field_Tree.png?alt=media&#x26;token=df34bc7f-d166-4490-bdf2-a8afbe1ee89f" alt=""><figcaption><p>Related elements within the Field Tree view</p></figcaption></figure>

<figure><img src="https://3920520305-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyZbW8vbNs5hz8x57emJJ%2Fuploads%2FnPefcm8KLB1TTrLXIgRu%2Fimage.png?alt=media&#x26;token=8c75fa1e-7bc7-47a5-b71b-437495db0e76" alt=""><figcaption><p>Loading related elements when printing the report by selecting the appropriate option</p></figcaption></figure>

### <mark style="color:blue;">**Integrating the data variables into the report**</mark> <a href="#related_elements" id="related_elements"></a>

In the example below, we have visually shown how the field list elements relate to the report layout designer.

<figure><img src="http://aquawiki.andagon.com/pictures/drex_element_tree_structure_1_custom_3.png" alt=""><figcaption></figcaption></figure>

### **Calculated Fields** <a href="#calculated_fields" id="calculated_fields"></a>

The values of calculated fields are determined by a formula and are calculated dynamically during report generation. To add a calculated field, select the part of the field list where you want to add it and click on  ![](http://aquawiki.andagon.com/pictures/drex_element_tree_structure_1_custom_4.png).&#x20;

<figure><img src="https://3920520305-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyZbW8vbNs5hz8x57emJJ%2Fuploads%2FApC9XPEQwQM87NZ8RgXb%2Fimage.png?alt=media&#x26;token=960fea7e-48bf-4c34-b7db-44b1e8754c1d" alt=""><figcaption><p>Accessing the option to add a calculated field</p></figcaption></figure>

<pre data-overflow="wrap" data-full-width="false"><code><strong>Iif([LastExecutionStatusInvariant]=='Passed', 1, 0) 
</strong><strong>// example expression that might define the value of a calculated field
</strong></code></pre>
