Versions Compared

Key

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

...

  • Downloaded and installed the iReport Designer Jaspersoft Studio application
  • Obtained a basic familiarity with using this application.
  • Set up or arranged for read-only access to the CollectionSpace databases.
  1. Download and install the iReport Designer Jaspersoft Studio application. This is free, open source software (GPL) from Jaspersoft, which you can download from:
    http
    https://sourceforgecommunity.jaspersoft.netcom/projectsproject/ireport/files/iReport/
    Ensure that you get at the minimum the 5.0.1 version, which is known to work with current CollectionSpace services.jaspersoft-studio/releases

  2. Read the tutorials on the same page , (and any others you choose to. These are a good introduction, even for our use of iReport.find useful). 
  3. Ensure you have at least read-only access to the database. If you are working on the server that hosts CollectionSpace, the default configuration will allow access. Otherwise, you need to have your admin give you allow remote access to the database .If you are using PostgreSQL, then have your administrator edit by editing the PostgreSQL configuration files to grant remote access.:
    1. In the main postgresql.conf file, there must be an entry like:

      Code Block
      listen_addresses = 'localhost, {your-machine}'        # what IP address(es) to listen on;

      where you or your administrator will replace "{your-machine}" with the IP address or hostname of the computer from which you will be connecting when you're authoring reports. See also the PostgreSQL documentation on Connections and Authentication.


    2. In PostgreSQL's host-based authentication file, pg_hba.conf, there must be an entry for a PostgreSQL database user account that will be given read-only privileges to the nuxeo database, for the purpose of performing queries and running reports. The following example specifies that access is granted to the nuxeo database to the PostgreSQL database user account named "reader," for remote connections from IP address 172.20.143.89, via username and password authentication (md5).

      Code Block
      host nuxeo reader 172.20.143.89/32 md5

      (In the example above, replace the example IP address given there with the actual IP address of the machine you will be connecting from. In place of specifying an individual IP address, you can instead specify a subnet range of addresses. For details, see the PostgreSQL documentation on the pg_hba.conf file..)

      If you are using MySQL, then have your administrator either execute the following command in the mysql client console, or by add the equivalent access in your admin console (replacing the placeholders in curly braces, below, with the appropriate values for your institution - be sure to remove the curly braces, as well):

      Code Block
      GRANT SELECT ON nuxeo.* TO 'reader'@'%.{YOURDOMAIN.ORG}' IDENTIFIED BY '{READER_PASSWORD}';

Procedure

Writing a report

Steps to create a new report in iReport DesignerJaspersoft Studio:

  1. In iReport Designer, create Create a new datasource to access the data in your repository. The easiest way is to select Window->Welcome to iReport, and then use the Quick Start wizard to create a new database connection.
    1. Click the Step 1 - Create a new database connection link.
    2. Select Database JDBC connection
    3. Type in a name you choose to refer to this connection (E.g., "Our Museum on CollectionSpace")
    4. In the JDBC URL Wizard section, type in the name (or IP address) of the server that runs your database, and enter "nuxeo" in the Database field, and then click on the Wizard button to generate the JDBC URL.
    5. Enter "reader" for the Username, and your local password.
    6. Click on the Test button to ensure your entries are correct.
  2. Create a new report. The easiest way is to use the Quick Start wizard on the Welcome window:
    1. Click the Step 2 - Create a new report link.
    2. Select a template you like, and click the Launch Report Wizard button.
    3. Set a name and location, and click Next.
    4. Choose the datasource your defined in Step 4 above.
    5. Click Design Query, select a table (e.g., collectionobjects_common), choose fields, and complete the wizard according to the tutorials.

You can explore the report authoring tool from this basic report. You will likely want to rename the labels, as the default labels based upon the data-model are not very user-friendly. In addition, certain fields will benefit from some expressions to simplify the value.  For example, field values that refer to authority terms (Person, Org, etc.) can be easily converted to a display value using the following expression, replacing "field" with the field name you are accessing:

...

In the query above, the tenant ID has been specified as a property in the iReport tool, and then the property value is used in the query. CollectionSpace will pass in the current tenant ID when the report is run from the UI, so we can actually re-use the same report for different tenants in the system. For your testing, set the tenantid property to have a default value of the tenantid you most commonly use. This tenantid is the one specified in the tenant configuration file for the services, for your tenant. See also: Creating your new tenant.

...