Information Reports

<< Click to Display Table of Contents >>

Navigation:  Layers >

Information Reports

Information reports are used to display descriptive information regarding map elements. These reports can display attributes extracted from the underlying spatial data source or information from databases outside JMap. Each layer can have zero, one or more reports. The information reports are presented as web pages or PDF documents.

To configure reports for a layer, click on Reports in the layer's details section.

The reports section shows the list of existing reports for a layer. In JMap applications, reports are presented in this order. You can change the order using the arrows. To create a new information report, press Create. To delete a report, press Delete.

Creating a report

There are three different types of reports: Basic, Advanced and Custom.

Basic

Basic reports are generated as web pages. They contain features to be printed and exported in Excel. Tables containing the values can be sorted by clicking on the column headers. You can also configure the names of the fields to be displayed in the reports.

An example of a basic information report 

An example of a basic information report

Configuration

Title

The title of the report.

Extract data from

Current layer: Obtain report data directly in the layer attributes. Refer to Report data sources - Current layer.

External database: Obtain report information from an external database connected to JMap. The database must contain a field that links to an attribute of the layer. Refer to Report data sources - External database.

Template (single)

Template used for reports on a single map element.

Template (multiple)

Template used for reports on multiple map elements.

Attributes

Title

Text to be displayed in the report instead of the attribute name.

Advanced

Advanced reports are based on the BIRT reporting tool (http://www.eclipse.org/birt/). A default report template is provided with JMap. You can also use the BIRT report Designer application to create custom reports or to edit the template provided in order to adapt it to your needs (add a logo, change the colors, etc.). For more information on report development, visit the BIRT website (http://www.eclipse.org/birt).

Reports can be generated in HTML or PDF format. Geographic map integration is also supported.

An example of an advanced report with a map 

An example of an advanced report with a map

Advanced reports

Format

HTML: The report is generated as a web page. Tools allow you to export and print the report's content. If the report is created for multiple map elements, its content can be sorted by clicking on the column headers.

PDF: The report is generated in PDF format. This format is better suited for printing because the page layout is better. However, the content of this type of report is more static compared to the HTML report.

Title

The title of the report.

Extract data from

Current layer: Obtain report data directly from layer attributes. Refer to Report data sources - Current layer.

External database: Obtain report data directly from an external database connected to JMap. The database must contain a field that links to an attribute of the layer. Refer to Report data sources - External database.

Template (single)

Template used for reports on a single map element. Two templates are available:

inforequest.rpttemplate: Basic template containing a table, arranged vertically.

inforequestMap.rpttemplate : Similar to basic template but also contains a geographic map.

Refer to Report templates (Advanced reports).

Template (multiple)

Template used for reports on multiple map elements. Two templates are available:

selectionreport.rpttemplate: Basic template containing a table, arranged horizontally.

selectionreportMap.rpttemplate: Similar to basic template but also contains a geographic map.

Refer to Report templates (Advanced reports).

Report templates (Advanced reports)

With advanced reports, you can choose the report template you wish to use. By default, two templates are provided with JMap: a basic report template and a report template with an integrated geographic map. Each one of these templates is also available in two versions: one version is for a single element and the other is for a selection of multiple elements. You can create your own report templates based on the existing templates and add them to those provided by JMap. You can then select your templates to configure reports. The report template files (.rpttemplate) are placed in the JMAP_HOME/applications/templates/reports directory. Your templates must be placed in the single or multiple sub-directory, depending on whether they are in single element or multiple element version.

Custom

Custom reports are external to JMap and can be called using a URL. These reports can come from reporting tools (e.g. Crystal Reports, Jaspersoft, etc.) or from simple web pages.

A special syntax allows you to format the parameters to be passed in order to open the report.

General information

Title

The title of the report.

Report URL

Enter the URL that will allow you to open the external report. You will probably have to pass certain parameters in the report URL to identify the elements for which you wish to open a report. The parameter values usually come from the bound attributes of map elements. A special syntax is used to format the parameters.

For example, if your report must be called by this URL:

http://myserver/reports/myreport?id=3

then, if the 0 attribute contains the parameter values, the following syntax must be used:

http://myserver/reports/myreport?id=%0

 

However, if your report can include information on a selection of multiple map elements, the parameter syntax can take one of two different forms. If your report must be called by the following URL:

http://myserver/reports/myreport?id=3,4,5

then, if the 0 attribute contains the parameter values, the following syntax should be used:

http://myserver/reports/myreport?%param[%0,'id',',']

This syntax uses the expression %param[Attribute, Parameter, Separator].

 

If your report must be called by this URL:

http://myserver/reports/myreport?id=3,id=4,id=5

then, if the 0 attribute contains the parameter values, the following syntax should be used:

http://myserver/reports/myreport?%param[%0,'id']

This syntax uses the expression %param[Attribute, Parameter].

 

It is also possible to include other variables to compose the URL, such as %f, %p, %u, %h, etc. Refer to Supported variables for more information.

Supported variables in the URLs of custom reports

Variable

Display

%n

Replaced by the corresponding bound attribute value for the element. For example, %0 refers to the 1st bound attribute, %1, to the second one, etc.

%f

Replaced by a formatted number or date. There are 2 possible formats:

%f[%n^D^dd/MM/yyyy]

where %n refers to an attribute containing a date, D indicates that we want to display a formatted date and dd/MM/yyyy is the format pattern, as indicated in the Java class java.text.SimpleDateFormat documentation.

%f[%n^N^##0,00]

where %n refers to an attribute containing a number, N indicates that we want to display a formatted number and ##0,00 is the format pattern, as indicated in the Java class java.text.NumberFormat documentation.

%p

Replaced by the currently opened project name.

%u

Replaced by the name of the user currently logged in.

%s

Replaced by the current session id.

%h

Replaced by the host name or address of the JMap Server instance the client is connected to.

%o

Replaced by the port number (http or direct) of the JMap Server instance the client is connected to.

%t

Replaced by the current time (date and time).

Report data sources

Basic and advanced reports can take their data from layer attributes or from an external database connected to JMap.

Current layer

Select the Current layer option to create a simple report that will only query the layer attributes (read below for the External database option). Afterwards, select the attributes to include in the report using the check boxes. Only the selected attributes will be displayed to the user; the others will be excluded from the report. Lastly, you can specify titles for the attributes; these will be displayed to the user instead of the actual attribute names.

External database

Selecting the External database option will instruct JMap to display information taken from another database, instead of the layer. This option allows you to query any database that has a field corresponding to one of the layer's attributes.

Attributes

Database

Select the database from which the report data will be extracted. The database to query must have been configured in JMap Admin beforehand.

SQL query

Enter the SELECT SQL query that will be used to extract the data from the database. This query can have several tables. The query must include the key field used to join with a layer attribute.

Afterwards, you must click on Execute in order to execute the query once.

Join fields

Table

Select the table containing the join field.

Field

Among the fields in the selected table, select the field that will be used to join with the layer.

Attributes

Select the layer attribute that will be used to join with the data from the database.

Captions

For reports that take their data from an external database, you can define the names of the fields to be displayed in the report, instead of using the field names in the database. Click on Captions to define these field names.