Difference between revisions of "Use iReport"

From IMSMA Wiki
Jump to: navigation, search
(Accident)
(Accident)
Line 372: Line 372:
 
| align="center" width="250pt" | '''Data type'''
 
| align="center" width="250pt" | '''Data type'''
 
|-
 
|-
|Accident Description
+
| Accident Description || Text
Accident ID
+
|-
Area Marked
+
| Accident ID || Varchar(50)
Area Officer
+
|-
Clearance In Progress?
+
| Area Marked || Varchar(38)
Confirmed
+
|-
Data Gathered By
+
| Area Officer || Varchar(50)
Date of Accident
+
|-
Description of ref area
+
| Clearance In Progress? || Varchar(38)
Distance From Nearest Town
+
|-
Distance From City
+
| Confirmed || Varchar(38)
Equipment Damage
+
|-
Guid
+
| Data Gathered By || Varchar(25)
Inquiry Report Reference
+
|-
Lat/Long
+
| Date of Accident || Datetime
Linked Victim Name(s)
+
|-
Location ID
+
| Description of ref area ||
Mine Action Activity Type
+
|-
Municipality
+
| Distance From Nearest Town || Text
Number of Linked Victims
+
|-
Number of Persons Involved
+
| Distance From City ||
Property Damage
+
|-
Reliability of Information
+
| Equipment Damage || Float
Reliability of Source
+
|-
Source
+
| Guid || Varchar(38)
Type of Accident
+
|-
Type of Area
+
| Inquiry Report Reference || Text
Type of Hazardous Area
+
|-
Unknown Device
+
| Lat/Long ||
Was Mine/UXO Marked?
+
|-
||Text
+
| Linked Victim Name(s) || A derived field that returns A comma separated list of the names (first and last) of all victims that are linked to the accident.
Varchar(50)
+
|-
Varchar(38)
+
| Location ID || Varchar(38)
Varchar(50)
+
|-
Varchar(38)
+
| Mine Action Activity Type || Varchar(38)
Varchar(38)
+
|-
Varchar(25)
+
| Municipality || Varchar(125)
Datetime
+
|-
 
+
| Number of Linked Victims || A derived field that returns the number of victims that are linked to the accident.  
Text
+
|-
 
+
| Number of Persons Involved || Int(10)
Float
+
|-
Varchar(38)
+
| Property Damage || Float
Text
+
|-
 
+
| Reliability of Information || Varchar(38)
A derived field that returns A comma separated list of the names (first and last) of all victims that are linked to the accident.
+
|-
Varchar(38)
+
| Reliability of Source || Varchar(38)
Varchar(38)
+
|-
Varchar(125)
+
| Source || Varchar(50)
A derived field that returns the number of victims that are linked to the accident.  
+
|-
Int(10)
+
| Type of Accident || Varchar(38)
Float
+
|-
Varchar(38)
+
| Type of Area || Varchar(38)
Varchar(38)
+
|-
Varchar(50)
+
| Type of Hazardous Area || Varchar(38)
Varchar(38)
+
|-
Varchar(38)
+
| Unknown Device || Varchar(38)
Varchar(38)
+
|-
Varchar(38)
+
| Was Mine/UXO Marked? || Varchar(38)
Varchar(38)
 
 
|}
 
|}
 
</center>
 
</center>

Revision as of 14:26, 24 October 2012

Introduction

i-Report

iReport is a third-party application that allows you to generate custom-defined reports on IMSMA data. Using iReport, you may define the attributes that are returned by a report and also customise the appearance of the report.

How To Use This Manual

This guide provides information for using iReport with IMSMA. It provides the steps for configuring and using iReport to report on IMSMA data. It is not intended to serve as a complete guide for using iReport. For detailed information on using iReport, refer to the iReport help or documentation.

Conventions

Table 1 lists the conventions used in the manual.

Table 1. Conventions
Convention Meaning
Bold Indicates menu, button, icon, or list names.
[Bold in brackets] Indicates a keyboard key.
Italics Indicates text that should be typed exactly as it is shown in the user manual into a field. Italicized text is also used to note options that may be selected from a list.
Note.jpg Indicates a tip for using IMSMA.
Warning.jpg Indicates steps for completing a task.
40px Indicates an error that you might encounter.

Sample Reports

IMSMA includes several iReport sample reports. These reports may be used as is or used as a reference to create your reports. The sample reports are installed in the \iReports\IMSMA reports directory of your IMSMA installation directory.

Article 7: Form A

The Article 7: Form A report returns the total area size of all reductions that are being reported on, the total area size of all hazards that have been linked to the reported reductions, and a count of all victims that have been linked to the reported reductions. If a search definition is associated with the report, the search definition name will be displayed in the report title.

Figure 41. Sample report - Article 7 form A

Table 6

File name Article 7 Form A.jrxml
Data source Hazard reduction
Variables Sum of hazard reduction area size

Sum of total hazard area size Sum of victim counts

Derived fields HazreducLinkedHazardAreaSize (Total Hazard Area Size)

HazreducLinkedVictimCount (Victim Count)

Sub-reports None

Article 7: Form C

The Article 7: Form C report returns a crosstab by district and hazard with the number of hazards by hazard type.

Figure 42. Sample report – Article 7 form C

Table 7

File name Article 7 Form C.jrxml
Data source Hazard
Variables REPORT_COUNT (built-in iReport variable)
Derived fields None
Sub-reports None

Bar Chart Sample

The Bar Chart sample report returns the metal contamination level of hazards and area size. The report includes a bar chart which summarizes the total area size of hazards by their metal contamination level.

Table 8

File name Bar Chart Sample.jrxml
Data source Hazard
Variable Sum of area size

Count of metal contamination level

Derived fields None
Sub-reports None

Clearance by Year and District

The Clearance by Year and District report returns the total area cleared, hours spent, devices, and number of positive samples grouped by year and district.

Table 9

File Name Clearance by Year and District Sample.jrxml
Data source Hazard reduction
Variables Count variables for all the derived fields
Derived fields One derived field for each device sub-category (i.e., Anti-Tank, Anti-Vehicle, etc.,) created by using parameterized derived field com.fgm.imsma.ext.report.OrdnanceWithSubCategoryExists, passing in the device subcategory imsma enum.
Sub-reports None

Hazards by Ordnance Type

The Hazards by Ordnance Type report shows summary data based on the full set of Ordnance Types present. This report groups Hazards based on the full list of Ordnance SubCategories that are found on the Hazard. The report displays the name of the search in the report title.

Table 10

File name Hazards by Ordnance Type.jrxml
Data source Hazard
Variables Count of hazards for each ordnance sub-category

Sum of area size, Average of area size

Derived fields HazardOrdnanceSubCategoryList (Ordnance SubCategory List)
Sub-reports None

MRE Audience Totals by Age

The MRE Audience Totals by Age report lists the different age categories of MRE audiences and the total number of male, female, and unknown gender in each age category.

Table 11

File name MRE Audience by Age.jrxml
Data source MRE Details
Variables Sums of each gender (derived fields) by group and report

Sum of total audience by group and report Count of number of events (MRE Details) by group and report

Derived Fields MREDetailMaleAudience (Total Male Audience)

MREDetailFemaleAudience (Total Female Audience) MREDetailUnknownAudience (Total Unknown Audience)

Sub-reports None

Pie Chart Sample

The Pie Chart sample report returns the metal contamination level of hazards and area size. The report includes a pie chart which summarizes the total area size of hazards by their metal contamination level.

Table 12

File name Pie Chart Sample.jrxml
Data source Hazard
Variables Sum of area size

Count of metal contamination level

Derived fields None
Sub-reports None

Accident Victim Summary Report

The Accident Victim Summary report lists accidents and the victims that are linked to them. In this example, the victim data is linked to the accident and returned via a sub-report. For this type of report, compile the sub-report (Sub-reports\Summary_AccidentVictim_sub-report0.jrxml) before attempting to run the main report.

Set the SUB-REPORT_DIR parameter to .\Sub-reports\.

Table 13

File name Summary_AccidentVictim.jrxml
Data source Accident

Query executor (used by victim sub-report)

Variables Sum of area size

Count of metal contamination level

Derived fields None
Sub-reports Sub-reports\Summary_AccidentVictim_sub-report0.jrxml

Hazard Summary Report

File: Summary_Hazard.jrxml Data source: Hazard

Hazard Reduction Summary Report

File: Summary_Hazreduc.jrxml Data source: Hazard Reduction

Location Summary Report

File: Summary_Location.jrxml Data source: Location

MRE Summary Report

For this type of report, compile the sub-report (Sub-reports\Summary_Mre_sub-report1.jrxml) before attempting to run the main report.

Set the SUB-REPORT_DIR parameter to .\Sub-reports\.

Table 15

File name Summary_MRE.jrxml
Data source MRE

Query executor (used by the sub-report)

Derived fields None
Sub-reports Sub-reports\Summary_Mre_sub-report1.jrxml

Organisation List Report

File: Summary_Organisation.jrxml Data source: Organisation

Place List Report

File: Summary_Place.jrxml Data source: Place

Quality Control Summary Report

File: Summary_QA.jrxml Data source: Qa

Appendix A: IMSMA Database

Overview

The IMSMA database contains tables for IMSMA’s base data (country structures, explosive, ordnance, organisations, and places), locations, and the locations’ associated accidents, hazards, hazard reductions, MREs, QCs, and victims.

Figure 56. Conceptual database model

Within each country structure are zero or more locations. For example, a particular province may have multiple locations within it while another province has no locations. Each location may have zero or more items such as accidents, hazards, hazard reductions, MREs, QCs, or victims associated with them. These accidents, hazards, hazard reductions, MREs, QCs, or victims are added to the IMSMA database via field reports.

IMSMA items may have either a direct or a linked relationship to other items. Direct relationships occur when one item requires the other item to exist. For example, an accident, hazard, hazard reduction, MRE, QC, or victim has a direct relationship to the location to which it is associated. The accident, hazard, hazard reduction, MRE, QC, or victim cannot exist unless it is associated with a location. This direct relationship is enforced in IMSMA via the reconciliation process. Direct relationships also exist when subsets of data are contained within an item. For example, an MRE may have MRE details such as the MRE type, total audience, and percentage of women and men. The MRE details data requires the MRE to exist. Table 15. Direct relationships between items lists the items and the data subsets that depend on them.

Table 15. Direct relationships between items
Parent item Child item(s) which require the parent item
Hazard reduction Impact survey

Interviewee Organisation Question Sample Sector Vegetation removal

Location Accident

Hazard Hazard reduction MRE QA Victim

MRE MRE details
Victim Received MRE

Linked relationships are optional relationships which may exist between items. Accidents, hazards, hazard reductions, MREs, QCs, and victims may be related to one another via links. For example, a victim may be associated to an accident in a particular hazard. If these relationships are known, IMSMA users may define these links while reconciling the field report.

Guids

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, and in determining what links exists between item records.

All accidents, hazards, hazard reductions, MREs, QCs, 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 (Figure 57).

Figure 57. location_guid

The location_guid field in the item table contains the guid of the location to which the item record is associated. Figure 58 shows an example of a location and the accident and hazard that are associated to the location. Notice that the location_guid value (1234-1234) in the accident and hazard are identical to the location_guid of the location.

Figure 58. location_guid example

When you create a report on a location and its associated items, you will need to use location.guid = "$P{LocationParamName}" in the query of the sub-report where LocationParamName is the name of the parameter that you created for the location (Figure 59).

Figure 59. Sub-report query for location and associated items

IMSMA allows users to define relationships between item records of differing types. For example, an accident may be related to a particular hazard. These relationships are referred to as links. The link table contains the links that have been defined between item records. The link table contains the guid of the item from which the link was established (from_guid) and the guid to which the link is being established (to_guid). Figure 60 shows an example of a link that was created from an accident to a hazard. These links are stored in the link table.

Figure 60. Link table example

When you create a report that includes linked items, you will need to use links.toGuid = "$P{PrimaryParamName} in the query of the sub-report where PrimaryParamName is the name of the parameter that you created for the primary report item (Figure 61).

Figure 61. Sub-report query for linked items

Appendix B. Data Source Fields

The following sections list the various data sources that are available in iReport and the fields within them.

Need to add derived fields to this list

Accident

A field for each country structure level will also be available. Because the country structure levels may vary for each site, these fields are not listed below.

Accident fields
Field name Data type
Accident Description Text
Accident ID Varchar(50)
Area Marked Varchar(38)
Area Officer Varchar(50)
Clearance In Progress? Varchar(38)
Confirmed Varchar(38)
Data Gathered By Varchar(25)
Date of Accident Datetime
Description of ref area
Distance From Nearest Town Text
Distance From City
Equipment Damage Float
Guid Varchar(38)
Inquiry Report Reference Text
Lat/Long
Linked Victim Name(s) A derived field that returns A comma separated list of the names (first and last) of all victims that are linked to the accident.
Location ID Varchar(38)
Mine Action Activity Type Varchar(38)
Municipality Varchar(125)
Number of Linked Victims A derived field that returns the number of victims that are linked to the accident.
Number of Persons Involved Int(10)
Property Damage Float
Reliability of Information Varchar(38)
Reliability of Source Varchar(38)
Source Varchar(50)
Type of Accident Varchar(38)
Type of Area Varchar(38)
Type of Hazardous Area Varchar(38)
Unknown Device Varchar(38)
Was Mine/UXO Marked? Varchar(38)