ReportJoinConditions.xml

Once you have created a reportable object (view or summary table) and listed the attributes in ReportAttributes.xml, you are ready to report on the object. But in most reports, you will want to include additional attributes in addition to the attributes of the newly-created reportable object. This means that you need to define a way to associate other objects with this newly-created reportable object. In SQL terminology, you need to define join conditions. In the reportable object that you created in the previous examples, you might have noticed that you also had an entity_idcolumn that you did not add to the ReportAttributes.xmlfile. Use this column to connect the new reportable object with the entity object. If you assume that this is the only join defined in ReportAttributes.xmlfile, the content would look like this.

<?xml version="1.0" encoding="utf-8"?>

<JoinConditions>

 <JoinCondition key="aglv_archived_assessments, agl_entity">

 INNER JOIN agl_entity %2% ON %2%.entity_id = %1%.entity_id</JoinCondition>

</JoinConditions>

In the xml, you have defined a new join condition that can connect the newly created reportable object with to the agl_entity table. The join condition is identified by a key which is made up of the table names in lower case and separated by a comma. Please note that there is a single space after the comma. The actual join condition is a SQL like join clause with variables that are replaced at run time with the actual table aliases. The following is a list of columns that are most commonly used to connect to other tables.

Column NameTable/Object NameTable NameReport Attributes Group Name
entity_idEntity/Entity Tableagl_entityEntity
raproject_idAssessmentagl_raprojectRAProject
auditproject_idAssessment Programagl_auditprojectAuditProject
policyset_idControls, Policies, Questionnaires, etc.agl_policysetPolicySet
vulnerability_idVulnerabilitiesagl_vulnerabilityVulnerability