2,186
edits
Changes
no edit summary
==Advanced Reports==
===Sub-Report===
<p>Sub-report is reports within a report; thus, providing a way to generate a report that includes data on the target IMSMA Item as well as data on other IMSMA Items that are associated to the target IMSMA Item. Generally a sub-report is used in a situation where you have one or more sets of data relating to a single IMSMA item. A common use case would be a Location report with multiple details bands of different IMSMA items (HazardLand, Hazard ReductionActivity, Accident, Victim, MREEducation, and QCQM).</p>
<p>Regardless of what IMSMA data you’re including in your report and sub-reports, there are 6 basic steps to create a report with sub-reports:</p>
====''Step 1 – Create the Main Report''====
<p>Before creating the main report, you will need to determine what data to be included on your report. For example, if you are creating a report about Hazard Land with all the Progress Report data, then the target IMSMA item for your main report should be Hazard Land and the target data for your sub-report should be Hazard Reduction Activity assuming that Progress Reports are entered into the system as Hazard ReductionActivity. Below is a list of questions and things to be considered when designing a report.</p>
*What are all the data to be included on the report?
*What is the target IMSMA Item for the Main report? This is the primary data of your report.
<ol type="a" start="4">
<li>Click '''Next''' to define a new sub-report unless you have an existing report that you would like to use for sub-report.</li>
<li>Select from the '''Connection/Data Source''' list. This should be the IMSMA item determined as the secondary data of your report. For example, if you are creating a report about Hazard Land with Progress Reports, then “Hazard Reduction” “Activity” should be the data source for the sub-report. Click Next.</li>
<li>Select the attributes to be included in your sub-report. Click '''Next'''.</li>
<li>Select the layout option. Click '''Next'''.</li>
<td>Location</td>
<td>location_guid</td>
<td>HazardLand,Hazard ReductionActivity,
Accident,
Victim,
</td>
<td>location_guid</td>
</tr>
<tr>
<td>HazardLand, Hazard ReductionActivity,
Accident,
Victim,
</td>
<td>object_guid</td>
<td>HazardLand, Hazard ReductionActivity,
Accident,
Victim,
</td>
<td>object_guid</td>
</tr>
<tr>
<td>Hazard ReductionActivity</td>
<td>hazreduc_guid</td>
<td>Impact survey,
<td>hazreduc_guid</td>
<td>hazreduc.guid = "$P{hazreduc_guid}"</td>
<td>Relationship is defined as “New” to a Hazard Reduction an Activity during the reconciliation.</td>
</tr>
<tr>
==Reports on Items with a Direct Relationship==
<p>The reports discussed so far in this training module have been based on a single data source. In this part of the training module, you will learn to create more complex reports that reference multiple data sources. Some items are dependent on the existence of another item. This type of relationship is referred to as a direct relationship. For example, an accident, hazardland, hazard reductionactivity, MREeducation, QCQM, or victim has a direct relationship to the location to which it is associated. The accident, hazardland, hazard reductionactivity, MREeducation, QCQM, or victim cannot exist unless it is associated with a location. This direct relationship is enforced in IMSMA via the reconciliation process.</p>
[[Image:iRep11.png|center|500px|''Figure 11. Location and item records directly associated with it'']]
All records in IMSMA have a ''guid''. A ''guid'' is a unique value that identifies the record in the IMSMA database. Because the guid is lengthy and comprised of alphanumeric characters, it is typically not a useful value to display in a report. However, the guid is necessary in determining which item records have a direct relationship.
All accidents, hazardslands, hazard reductionsactivities, MREseducations, QCsQMs, and victims are associated with a single location. The information about the location to which an item record is associated is stored in the location_guid field of the item table and corresponds to the location_guid of the location to which it is associated ([[:Image:iRep03.png|Figure 13]]).
[[Image:iRep13.png|center|500px|''Figure 13. location_guid'']]
</div>
The location_guid field in the item table contains the guid of the location to which the item record is associated. [[:Image:iRep14.png|Figure 14]] shows an example of a location and the accident and hazard land that are associated to the location. Notice that the location_guid value (1234-1234) in the accident and hazard land are identical to the location_guid of the location.
[[Image:iRep14.png|center|500px|''Figure 14. location_guid example'']]
| width="450pt" | '''Child item(s) which require the parent item'''
|-
| Hazard reduction Activity || Impact survey
Interviewee
Organisation
|-
| Location || Accident
Victim
|-
| MRE Education || MRE Education details
|-
| Victim || Received MREEducation
|}
</center>
==Reports on Linked Items==
Part 4 of this training module discussed direct relationships—relationships where the parent item must exist in order for the child item to exist. In this part of the training, you will learn about linked relationships. Linked relationships are optional relationships which may exist between items. Unlike direct relationships that are enforced during the IMSMA reconciliation process, links are optional. Accidents, hazardslands, hazard reductionsactivities, MREseducations, and QCs QMs may be related to one another via ''links''. For example, a victim may be associated to an accident in a particular hazardland. If these relationships are known, IMSMA users may define these links while reconciling the field report.
[[Image:iRep21.png|center|500px|''Figure 21. Direct relationships vs. Links'']]
The process for creating a report on an item and its linked items is similar to the process for creating a report on items with a direct relationship. The item in the main report is the primary item for which you would like to find linked items. The sub-report would return the records for the particular item that is linked to the primary item. The key difference is the query used in the sub-report.
If you would like to report on different items that linked to the item in the main report, you may create a new sub-report for each linked item. For example, to create a report of hazards lands and the accidents and hazard reductions activities that are linked to those hazardslands, you would create the main report on hazardlands. This report would then contain a sub-report to list linked accidents, and another sub-report to list linked hazard reductionsactivities.
====Part 1. Create a report with attributes for a primary item====