Working with the BIRT Report Designer

The Eclipse-based BIRT Report Designer provides core reporting features such as report layout, data source configuration, and scripting features that render content and layout dynamically during report generation. You must set up the BIRT Report Designer before you can develop custom reports.

Before you begin

The BIRT Report Designer is a stand-alone Eclipse project bundle that can be downloaded and installed on any machine. Details about the BIRT Designer are available here:

http://www.eclipse.org/birt/about/designer.php

Download and install the Report Designer Full Eclipse Install package. The latest versions of the BIRT packages are available from this download page:

http://download.eclipse.org/birt/downloads/

However, the instructions apply to BIRT version 4.6. To download this specific version, navigate to the BIRT 4.6.0 download site by selecting Recent Builds > 4.6.0.

You can also extend an existing Eclipse installation by adding the Report Development feature. Within the Eclipse application, go to Help > Install New Software and click Add to add a site for BIRT:

http://download.eclipse.org/birt/update-site/4.6.

This URL is for BIRT version 4.6.

A JDBC driver is required to access the "enamel" database from BIRT. Download the latest PostgresSQL JDBC driver and save it in a location that is accessible by BIRT:

http://jdbc.postgresql.org/download.html

Procedure

To create a report definition:

  1. Create a report.
    After you set up your development environment, you must create a new report in the BIRT Report Designer tool before you can develop your custom report.
    1. Open BIRT Report Designer and start a new project by selecting File > New > Project.
    2. Expand Business Intelligence and Reporting Tools, select Report Project and click Next.
    3. Select a suitable project name and location, and click Finish.
    4. Now, start a new report by selecting File > New > Report.
    5. Select the project that you created previously.
      Enter a suitable name for the new report.
    6. Select a template to start with, for example, the Blank Report template.
    7. Click Finish.
  2. Connect to the reporting database:
    1. Create a data source by selecting Data > New Data Source.
    2. Select JDBC Data Source, specify a suitable name and click Next.
    3. Click Manage Drivers, then click Add and select the JDBC driver that you downloaded as a prerequisite. Click OK.
    4. In the Create a new data source window, select org.postgresql.Driver in the Driver Class list and provide the rest of the information as described:
      • Database URL: jdbc:postgresql://appstack-host:5432/enamel
      • User name: reportuser
      • Password: Contact your administrator for the reportuser password to specify here.
      • JNDI URL: You can leave this field empty.
    5. To confirm that the connection settings are working, click Test Connection.
    6. Click Finish.
    Alternatively, you can create a connection profile for repeated use:
    1. From the main menu, select File > New > Other.
    2. From Connection Profiles, select Connection Profile and click Next.
    3. Select BIRT JDBC Data Source as connection profile type.
    4. Enter a unique name for the connection profile and optionally a description. Then, click Next.
    5. Provide the required connection information as described before.
    6. Test the connection to verify that the connection profile is working.
    7. Click Finish.
  3. Define required report parameters.
    Such report parameters must be provided when a user renders the report. Currently, IBM® StoredIQ® supports only one report parameter, which must map to the infoset ID.
    1. From the main menu, select Data > New Report Parameter > New Parameter.
    2. Enter a descriptive name such as infoset_id.
    3. In the Prompt text field, enter the message that must be displayed to the user who renders the report.
    4. Set other properties as follows.
      For this parameter, the data type must be set to String, the display type must be Text Box, and the Is Required option must be selected.
    5. Click OK.
  4. Create data sets.

    A Data Set is subset of the data available within a data source. It is typically defined by providing a SQL query including sort and filter criteria. This defines the data on which the report is based.

    After you set up a data source and created report parameters, a new data set can be created in the following way:

    1. In the Data Explorer view, right-click Data Set and select New Data Set.
    2. In the New Data Set window, select the data source that you created previously.
    3. Select SQL Select Query from the Data Set Type list and enter a suitable name in the Data Set Name field. Then, click Next.
    4. Under Query Text, enter the SQL query that is used to fetch the data specific to the report.
      If you want to target the data of a specific infoset, include a where clause:
      select * from report_schema.infoset where infoset_id = ?;
      The ? denotes that a report parameter must be used here. In this case, you must add a parameter to the data set.
    5. Optional: To add a report parameter, select Parameters and click New.
      Then, change the Linked to Report Parameter value from None to the name of your report parameter that is created during data set creation and click OK

      You can refine the data set at any time by editing it.

    6. Click Preview Results to view the data fetched from the query.
      If everything looks correct, click OK to close the window.
  5. Design the report.
    BIRT Designer provides a variety of controls and display elements that can be used to design engaging reports. These controls are available in the Palette window and can be added to the report by dragging them there.
  6. Test your design.
    Before you upload the customized report, preview the report as both HTML and PDF output to ensure that the report renders properly. From the main menu, select Run > View Report and then select the appropriate rendering: as HTML or as PDF.
  7. If everything looks fine, you can upload the report package in IBM StoredIQ Administrator.
    IBM StoredIQ supports uploading a report design in a compressed file. Report designs are expected to be in the rptdesign format within the compressed file. Currently, only one rptdesign is expected to be present within a compressed file. The design can use one or more .css files and one or more image files, which can all be packaged within the compressed file.
    To better manage the artifacts such as the images and stylesheets for a single report design package, you must do one of the following tasks:
    • Create a project for each report design. Each project contains only one rptdesign file.
    • Create a folder for each report design within the project. Each folder contains only one rptdesign file.
    By selecting one of the report-design management options, you can manage all images and stylesheets. They are used by the design in a single location, making the creation of the compressed file easier as you compress a folder. Additionally, the uploaded compressed file must meet the following requirements:
    • It contains only one rptdesign file and uses the file extension .rptdesign.
    • All CSS and images that are referenced from the rptdesign file are also present within the compressed file.
    • Only one report parameter is defined in the rptdesign file.
    • Images use these extensions: .bmp, .jpg, .jpeg, .jpe, .jfif, .gif, .png, .tif, .tiff, .ico, or .svg.
    • Stylesheets must use the .css file extension.