Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This article describes how Smart ID Identity Manager uses JasperReports to generate reports.

JasperReports is developed by Jaspersoft. The reports are created based on templates, that are created and modified in TIBCO Jaspersoft® Studio. It produces a .jrxml file, which stores all layout information. The .jrxml file represents the report template and is stored in the file system. JasperReports fills the template with data from a data source. The user uploads the report template in Identity Manager Admin.

...

Expand
titlePrerequisites
Note

Keep track of the software versions of JasperReports and TIBCO Jaspersoft Studio to make sure your report definitions are designed for the correct Identity Manager version. You find the relevant Jasper versions for different Identity Manager releases in Identity Manager requirements IDM 23.10.3 - Requirements and interoperability.


Work flow

Expand
titleWork flow in JasperReports

JasperReports is a Java open source tool for generating reports for several file formats, such as PDF, HTML, XML, XLS and CSV. JasperReport uses its own XML-dialect (jrxml) for the report definition. The printable report will be generated using the jrxml file together with data from the Identity Manager database. For more information, go to https://www.jaspersoft.com/.

The preparation phase

  • The preparation phase is done in Identity Manager Admin and Jaspersoft Studio.
  • The report definition is created with Jaspersoft Studio and uploaded to Identity Manager Admin.

Work flow:

  1. Modify an existing report template (jrxml) or create a new one using Jaspersoft Studio.
  2. Save the report definition as DefinitionName.jrxml.
  3. Upload the report definition in Identity Manager Admin. Use the menu item "Reports" in the navigation.
  4. Navigate to a Search Configuration or Form button and select the uploaded report definition.

  5. Save the Search Configuration or Form definition.

The execution phase

  • The execution phase is done in Identity Manager Operator.
  • The report data is collected from the data source and generated into the report output format.

To print the search results:

  1. Do a search in Identity Manager Operator.
  2. Click Export on the search result grid, select "PDF".
  3. The JasperReport engine creates a report result as a PDF file.

To print from a form within a process:

  1. Start the process that contains the print form in Identity Manager Operator.
  2. When the form shows up, click Next and the PDF viewer will show the generated document. "Silent printing" in the background is not supported in the HTML client, because the browsers do not support this.

...

Expand
titleSet up dynamic report definition

In Jaspersoft Studio you can either design a report definition from scratch or open one of the predefined reports delivered with Identity Manager to adjust the layout as needed.

If you create a new dynamic report, only templates for the the first column, the header and filter parameters are defined and the actual number of needed result columns is generated during runtime according to the specifications of the search configuration. Be careful to use the exact names as described here, because Identity Manager will use them to generate the report automatically.

To create the report definition in Jaspersoft Studio, do the following:

  1. Define one column, that serves as a template for the additional columns. 
    The number of report columns to be produced depends on the column count of the search result.
  2. Define one filter field as template for all filters specified in the search configuration (if filters should be displayed).
  3. Save the report definition file.
  4.  A pre-generation-mechanism creates the report definition dynamically and adds as many columns and filters as configured in the selected query.

The names of the template fields must be:

  • filterName0  :  placeholder for the name of the search field <Parameter>
  • filterOp0  : placeholder for the name of the operator <Parameter>
  • filterValue0  : placeholder for the result of the search <Parameter>

The base elements of this generic report must be:

  • value0  :  format for a column, placeholder for all columns <Field>
  • colHeader0  : column header, placeholder for all columns <Parameter>
  • reportTitle  : Report title <Parameter>

Refer to the documentation of Jaspersoft Studio for the details on report design.

To modify the predefined report definition, do the following:

  1. Use the predefined file generic.jrxml included in the Identity Manager delivery.
  2. Open it in Jaspersoft Studio and modify it as required, but be careful to keep the fix names as described above.

...

Expand
titleSet up static report definition

In Jaspersoft Studio you can either design a report definition from scratch or open one of the predefined reports delivered with Identity Manager to adjust the layout as needed.

In a static report definition the columns are not generated by Identity Manager as in the dynamic report, but taken as they are defined in the definition file. All fields are referenced by the name, so this will provide more flexibility according to report design. The disadvantage is that the report design only fits for search configurations that deal with the same fields as in the report. For example, if the report is based on person data, it only fits for search configurations for persons.

To create the report definition in Jaspersoft Studio, do the following:

  1. Add all field definitions according to the data pool fields to the report definition, for example $F{Person_LastName}. Make sure that the report definition matches the correct data pool variable syntax, DataPoolName_FieldName, for example Person_LastName.
  2. Add the columns in the details section of the report definition referring to the fields defined.
  3. Save the report definition file.

Example:

The report definition contains three fields:
$F{Person_LastName}: LastName variable from variable map
$F{Person_FirstName}: FirstName variable from variable map
$F{Person_PersonnelNumber}: PersonnelNumber variable from variable map.

Additionally a page number should be added to the report:
$V{Page_Number}: internal Jasper variable

Refer to the documentation of Jaspersoft Studio for the details on report design.

To modify the predefined report definition, do the following:

  1. Use the predefined file person_list.jrxml included in the Identity Manager delivery as an example.
  2. Open it in Jaspersoft Studio and modify it as required.

...

Expand
titleSet up dynamic report template with grouping

In the dynamic report, grouping can only be done by the first column of the search configuration's result columns. The structure of the report is the same as described in the section "Set up dynamic report definition", except that grouping is added.

  1. To adjust the layout of the report, open the file generic_grouping.jrxml in Jaspersoft Studio and customize it.
  2. Do not rename the predefined field names. They are needed later to generate the report from the search configuration settings.

Image Modified


Expand
titleSet up static report template with grouping

With a static report template it is possible to select any column for grouping without changing the order sequence of the search configuration.

This can be done because in a static report all fields are referenced by the name, and this provides more flexibility according to report design. The disadvantage is that the report design only fits for search configurations that deal with the same fields as in the report. For example if the report is based on person data, it only fits for search configurations for persons.

The structure of the report is the same as described in the section "Set up static report definition", except that the grouping was added.


...

...