Use lookup tables in views

Technologies > User Interface Add-Ins > Parts for Reports > Report with One Lookup Table

Technologies > User Interface Add-Ins > Parts for Reports > Report with Two Lookup Tables

Joining Tables


The data source can load fields from more than one table, if the tables are related. The following example loads the project_id and requestor field values from the project table, and the requestor email field value from the em table:

<dataSource>
<table name="project" role="main"/>
<table name=" em " role=" standard "/>
<field table="project" name="project_id"/>
<field table="project" name="requestor"/>
<field table=" em " name=" email "/>
</dataSource>


If the value of the foreign key in the main table is NULL, all fields from the standard table will be empty.

The second example contains two lookup tables, each related to the main table by a foreign key:

<dataSource id="reportGridMultitable_ds">
<table name="wr"/>
<table name="dp" role="standard"/>

<table name="probtype" role="standard"/>
<field table="wr" name="wr_id"/>
<field table="wr" name="dp_id"/>
<field table="dp" name="name"/>
<field table="wr" name="prob_type"/>
<field table="probtype" name="description"/>
</dataSource> Define a view datasource

Example 1: http://localhost:8080/archibus/schema/ab-products/solutions/parts/grid/ab-ex-report-grid-two-tables.axvw

Example 2: http://localhost:8080/archibus/schema/ab-products/solutions/parts/grid/ab-ex-report-grid-multitable.axvw