Reporting User Guide
Table of Contents
- Report Designer overview
- Installation
- openEQUELLA reporting
- Example reports
- Create a report
- Upload a report
- Run a report
- Data sets
- Freetext
- Joint data set example usage
- User management
- Scenarios
- Creating an openEQUELLA-Enabled BIRT Report Designer Binary
Report Designer overview
The openEQUELLA Report Designer is a customized version of BIRT™ (Business Intelligence and Reporting Tools), a product derived from the Eclipse Foundation™ that supports the development of complex reports using standard relational database queries.
The purpose of this guide is to provide administrators with an understanding of the openEQUELLA reporting process.
Please note that this guide has been developed to best reflect the full capabilities of openEQUELLA and as such may differ in appearance to your own installation.
Report creation overview
To create an openEQUELLA report the following tasks must be completed:
- A copy of the openEQUELLA Report Designer must be installed on a machine that can communicate with the openEQUELLA repository.
- A username and password for a user with the DESIGN_REPORT privilege must be provided to allow the Report Designer to connect to the repository.
- A report design is developed and tested.
- The report design is then uploaded to the openEQUELLA server.
Once created and uploaded, any user with suitable privileges can run the report by selecting the ‘Reports’ link from the openEQUELLA Digital Repository.
Prerequisites
Knowledge of SQL is an absolute requirement for generating reports with the Report Designer.
Additionally it is strongly recommended that training start with the online Eclipse BIRT tutorials:
http://www.eclipse.org/birt/phoenix/tutorial/
Installation
Versions of the openEQUELLA Report Designer are available for download from the open source community here. These versions are supported by openEQUELLA and use BIRT 2.6.1.
Install the openEQUELLA Report Designer
Download the Report Designer files
Install the Report Designer on Windows
- After downloading the archive file appropriate to your operating system.
- Unzip the contents of the archive file to a suitable location on a local machine.
- Run BIRT.exe to open the BIRT Report Designer Once the BIRT Report Designer is running, it is ready for report creation and editing.
Install the Report Designer on Linux/Mac
The Linux/Mac Report Designer files are versions of Eclipse with Business Intelligence and Reporting Tools, and the openEQUELLA plug-in, built in.
- Extract the contents of the file to a suitable location on your local filesystem.
- Inside the eclipse folder, run eclipse.
- Select a workspace by entering one of your own or leaving it as the default.
- Once inside Eclipse, select New, then Other, from the File menu, or press Ctrl+N to display the New dialog.
- Expand the Business Intelligence and Reporting Tools folder and select Report. You are ready to design your report.
openEQUELLA reporting
The following tasks must be completed to create a report that can be used with openEQUELLA:
- Create a report design using the openEQUELLA Report Designer.
-Connect to the database to access the necessary data.
-Retrieve specified data from the data source.
-Format the report presentation.
- Upload the report design to openEQUELLA using the Administration Console Reporting plug-in.
A single instance of the Report Designer can be used to create reports for multiple institutions, as each report design has a distinct database connection.
Example reports
The standard example reports can be found here. Community ‘open source’ example reports can be found (TBD).
Create a report
- Select New and then New Report from the File menu to open the New Report dialog.
- Enter a File name for the new report design.
- Select a File location for storing the report design, by checking the Use default box, or clicking Browse to select a location from the local file system.
- Click Finish. The new report is created and opened in the Report Designer.
The Report Designer can now be used to create a data source, data sets and a layout for the report.
Data sources
Each report requires a connection to a data source to retrieve data for the report. The Report Designer provides a custom data source that can be used for openEQUELLA reports. The Data Explorer view is used to create a connection to a database.
To create a data source
- Select the Data Explorer tab to activate the Data Explorer pane.
- Right-click Data Sources then choose New Data Source to display the New Data Source wizard
- Select openEQUELLA Datasource from the list of available sources.
- Enter a Data Source Name (e.g. Sample Data Source).
- Click Next to display the openEQUELLA Datasource Wizard.
- Enter the openEQUELLA institution URL for the openEQUELLA institution providing the report data (e.g. ‘http://equella.myinstitution.edu/institution/’).
- Enter the User Name and Password of a user with the DESIGN_REPORT privilege
- Click Test Connection to display a dialog indicating the connection state. If the connection could not be made, check the connection details and repeat the test.
(NOTE: Creating reports without a working connection is not recommended as data set columns and types cannot be verified, causing queries using the incorrect types to fail.)
- Click Finish to create a data source.
Data sets
Data sets specify what data to retrieve from the data source. A data set that returns report data can now be created from the previously created data source.
To create a data set
- Right-click on Data Sets in the Data Explorer tab and select New Data Set. The New Data Set wizard is displayed.
- Select a data source from your list of available data sources. In this case, it is the previously created ‘Sample Data Source’.
The openEQUELLA Report Designer provides the following data set types:
- UserManagement Dataset—provides user data stored in systems outside openEQUELLA.
- JDBC Data Set—provides data from the openEQUELLA database.
- Freetext Dataset—provides data by performing free text queries on item metadata, returning custom fields that are not stored directly in the database.
The following example uses the ‘mime_entry’ table from a JDBC Data Set.
- Select JDBC Data Set from the Data Set Type drop-down list
- Enter a Data Set Name. In the case, ‘Sample Data Set’.
- Next to display the JDBC Query wizard.
Queries can be created by dragging items from the Available Items list to the SQL query area. Queries can also be entered directly using Standard SQL.
- Create a query.
- Click Finish to create the data set.
The data set is displayed in the Edit Data Set dialog in Edit mode.
To provide a preview of the results returned by the query
- Select Preview Results. The results of the query are displayed.
- Click OK to close the Edit Data Set dialog.
The new data set and fields will be listed under Data Sets in the Data Explorer tab.
View or edit a data set
To view or edit the results returned by a data set:
- Select the Data Explorer tab to activate the window.
- Right-click the data set and select Edit. The Edit Data Set dialog is displayed.
- Test the query by selecting Preview Results from the left-hand pane.
Formatting the report
The Report Designer can now be used to format the report presentation using the Palette view.
- Select the Palette tab to activate the Palette pane.
- Click to drag a Table item and drop it onto the new report main layout window to display the data set results.
- On the Insert Table dialog that appears, select the Number of columns and Number of details to display. (NOTE: The ‘Number of details’ field represents the number of rows in the details band, which repeats for each row in the data set. For the purposes of this report, it is set at 1, as we just want to print out one line of data for each row.)
- Choose the appropriate Data Set.
- Click OK to create the table in the main layout window.
A table comprises a Header Row, Detail Row (data set results) and Footer Row.
- Click and drag the Text item from the Palette to each column in the Header Row. Doing so will open the Edit Text Item dialog each time, where Header details can be entered.
- To configure the Details Row, select the Data Explorer tab then expand the Data Sets.
- Drag the field (e.g. TYPE) from the previously created data set to the first column in the Detail Row.
- Drag the next field (e.g. DESCRIPTION) to the second column in the Detail Row.
- Save the new report.
Further information on report creation is provided in the BIRT documentation at http://www.eclipse.org/birt/phoenix/tutorial/.
Once the report is created it can be uploaded to any instance of an openEQUELLA institution.
Report parameters
Report parameters are values that can be passed into reports using BIRT. They are added to a report to filter results, restrict information users can view, or to allow one report to pass a parameter to another report. Report parameters can include simple parameters that a user can enter or a predefined list created from a table or several tables.
openEQUELLA provides a wizard where the user will be prompted to enter the parameter values when running the report.
Create a report with parameters
The following example creates a report with parameters the user can enter via a wizard when the report is generated in the openEQUELLA Digital Repository.
The details of this sample report are as follows:
- Report name—Status Report
- Parameter names—Version and Item Status
- Data Set name—Data Set Status
- Query type—JDBC Query
To create the report
- Create a new report (e.g. Status Report).
- Create a data source. (Hint: alternatively, right-click on a previously created data source and copy it, then paste it into the new report.)
To create the parameters
- Select the Data Explorer tab to activate the pane.
- Right-click on Report Parameters and select New Parameter. The New Parameter dialog is displayed.
- Enter a Parameter Name and Prompt text. An example ‘Version’ parameter is shown.
- Select a type (e.g. Decimal) from the Data type drop-down list. The openEQUELLA Report Designer provides Boolean, Date, Date Time, Decimal, Float, Integer, String, and Time data types.
- Select a display type (e.g. Text Box) from the Display type drop-down list. The openEQUELLA Report Designer provides Text Box, List Box, Combo Box and Radio Button display types.
- Enter a Default value.
- Click OK to save the details and close the New Parameter dialog.
- Create another parameter. An example ‘Item Status’ parameter is shown.
- Click OK to save the details and close the New Parameter dialog. The new parameters will be listed under Report Parameters in the Data Explorer tab.
To preview the parameters
- Select Report Parameters in the Data Explorer pane.
- Select the Preview tab in the center of the report designer. The preview of the parameter is displayed.
- Click OK to close the Enter Parameters dialog.The new parameters can now be added to a report query.
Parameters are added to a report query as a ?.
Example
The following example creates a JDBC data set called ‘Data Set Status’ and uses the previously defined ‘Item Status’ and ‘Version’ parameters.
To add the parameters to a report query
- Select the Data Explorer tab to activate the window.
- Right-click Data Sets and select New Data Set. The Edit Data Set dialog is displayed.
- Select a Data Source and enter a Data Set Name (e.g. Data Set Status).
- Select JDBC Data Set then Next to display the JDBC Query window.
- Create a query with parameters.
- Click Finish . The Edit Data Set dialog is displayed.
- Select Parameters from the left-hand pane.
- Select New to display the New Parameter dialog.
- Enter a name in the Name field (e.g. ITEM_STATUS).
- Select a type from the Data Type drop-down list. (NOTE: This should match the previously selected type for this parameter.
- Select a report parameter from the Linked to Report Parameter field (e.g. Item Status); this will automatically disable the Default Value field.
- Click OK to save your created parameter.
- Select Yes to confirm that you wish to update the report parameter’s value with the data set parameter’s value.
- Add another parameter. An example ‘VERSION’ parameter is shown with the ‘ITEM_STATUS’.
- Click OK to close the Edit Data Set dialog.
- Format the report presentation or drag the data set and drop it onto the new report main layout window to display the data set results in table format. Format the report using the Palette tab.
- Test the report by selecting the Preview tab in Report Designer.
- The report will run with the default parameters.
- To test the use of parameters, select Show Report Parameters from the Preview tab and enter values in the displayed fields. Once a report with parameters is uploaded to openEQUELLA the user will be prompted to enter parameter values before the report is generated.
Hyperlinks
Reports can be created that drill-through from one report to another. The main report passes the identity of the item to the drill-through report as a report parameter. If the item is a hyperlink, the drill-through report then uses the parameter value to display only data corresponding to the item the user clicked on.
This approach can be used to create landing pages for directing users to different reports when multiple report designs have been uploaded to a single openEQUELLA report.
Create a report with a hyperlink
The following example creates a main report with a hyperlink and a drill-through sub-report. The report details are as follows:
- Main report name—User Report
- Data Set name—User Data Set
- Query type—JDBC Query
- Sub-report name—Item Report
- Sub-report Parameter name—Owner
- Sub-report Data Set name—Item Data Set
- Sub-report Query name—JDBC Query
To create the main report with hyperlinks
- Create a main report (e.g. User Report)
- Create a data source
- Create a JDBC data set
- Format the report presentation with a table
To create a sub-report with a parameter
- Create a new report (e.g. Item Report) with a parameter (e.g. Owner)
- Create a JDBC data set with a parameter.
To add the new parameter to a report query
- Right-click the data set (e.g. Item Data Set) and select Edit to display the Edit Data Set dialog.
- Select Parameters from the left-hand pane.
- Select New and add the parameter.
- Click OK to close the New Parameter dialog.
- Click OK to close the Edit Data Set dialog.
- Save the report.
To add a hyperlink to a main report
- Select the main report in the Report Designer (e.g. User Report).
- Select the Detail Row cell you will create as a hyperlink.
- Select the Property Edit-Data tab. The Properties tab is displayed.
- Select Hyperlink from the Properties list.
- Click the Edit… button in the Link To: field to open the Hyperlink Options dialog.
-
Select the Drill-through radio button from the Select Hyperlink Type group to display the configuration options for drill-through hyperlinks.
- In Step 1: Select a target report: of the dialog, select the Report Design radio button.
- Click the folder button and navigate to the location of your sub-folder on the file system (e.g. Item Report).
- Select the sub-report then click Open to store the report.
To add the report parameters
- In the Report Parameters field, select the first blank cell under the Parameters column heading, and click the arrow button to display a list of available parameters.
- Select the already defined parameter. This is the parameter that will be passed through to the main report.
- Select the Values field then the … button to open the Expression Builder.
- Add the value:
a. Select a Category (e.g. Available Column Bindings).
b. Select a Sub-category (e.g. Table).
c. Double-click to insert the selected binding (e.g. uuid).
The completed Expression Builder dialog would display and show ‘row[“uuid”]’ as the selected column binding field set to the report table.
- Click OK to close the Expression Builder.
- In Step 5: Select a format for target report: of the dialog, check the checkbox alongside the Format the target report in: field.
- In the corresponding drop-down menu, select html. The hyperlink feature will not work if PDF is selected as the target format for the report.
- Click OK to save the options and close the Hyperlink Options dialog.
Once both the main report and the sub-report are uploaded to the openEQUELLA Resource Center, the main report will contain hyperlinks that when selected will drill-through to the sub-report and present only relevant information.
Create a landing page for handling multiple reports
This approach can be used to create landing pages for directing users to different reports when multiple report designs have been uploaded to a single openEQUELLA report.
Once you know which report design files you will be adding to your report, it is possible to create links to those report designs using the ‘drill-through’ approach. Hyperlinks can be added to your page which, when clicked, will execute the report.
Once completed, the landing page can be saved as a .rptdesign file and uploaded to openEQUELLA as part of a reporting archive.
Upload a report
Once the report is created it can be uploaded to any instance of an openEQUELLA institution. The data connection is automatically re-configured to use the server running the report.
Reports are uploaded using the Administration Console Reporting plug-in.
Upload a single report
- To open the openEQUELLA Administration Console Open a browser and enter your openEQUELLA URL (e.g. ‘http://equella.myinstitution.edu/logon.do’).
- Log in to openEQUELLA as an administrator user. The openEQUELLA Dashboard page is displayed.
- Select Settings from the left-hand navigation pane.
- Select Administration Console from the list of Settings categories.
- From the Administration Console, select Reporting.
- Click +Add to open the Report Editor dialog.
- Enter a Report Name and Description.
- Click Upload and navigate to a previously-created report design. (NOTE: Clicking the Download button will prompt the user to save a selected report design to the local filesystem.)
- Select the report design then click Open to upload it to the report.
- Configure Access Control, if required. 11. Click Save to save the report then click Close to close the Report Editor.
Upload multiple reports
It is possible to upload multiple report design files into a single openEQUELLA report, by combining the report files into a .zip archive. The archive can then be uploaded to an openEQUELLA report, creating the same effect as uploading the report design files individually.
- Create one or more report design files using the Report Designer.
- Add them to a .zip archive.
- Open the Administration Console Report 4. Editor, as described above.
- Enter a Report Name and Description.
- Click Upload and browse to your newly created .zip file.
- Click Open. The .zip file will attempt to upload to openEQUELLA. If there are no report design files inside the zip, you will see a warning dialog informing you to upload another file because that one is not valid. Valid file types include .rptdesign and .rptlibrary. Only .zip archive types are accepted.
With the .zip file uploaded, openEQUELLA automatically unpacks the files and displays them in the Administration Console.
With multiple report files uploaded, openEQUELLA needs to know which report to load first. This is configured in the Initial Report Design field of the Report Editor. While any report can be chosen for this purpose, it is good practice to design a purpose-built landing page where users can access the reports from.
- Select your landing page as the Initial Report Design by selecting the .rptdesign file from the drop-down menu, or leave it as the default.
- Click Save to save the report then click Close to close the Report Editor.
Run a report
The report access is controlled by the report Access Control and can be configured to suit the requirements of the institution. Users with the EXECUTE_REPORT privilege are able to run reports.
To run a report
- Open a browser and enter your openEQUELLA URL (e.g. ‘http://equella.myinstitution.edu/logon.do’).
- Log in to openEQUELLA as an administrator user. The openEQUELLA Dashboard page is displayed.
- Select Reports from the left-hand navigation pane.
- Select the newly create report (e.g. Example Dataset (MIME_TYPES)).
- Confirm that you are sure you want to run the selected report on the popup dialog.
The generated report will appear in a new browser window. The time required to generate a report depends on the complexity of the report and the system used to generate the report.
Run a report with parameters
When running a report with parameters, the user will be prompted to enter values. The display report will only contain information that matches the entered values.
The report can be generated using the default parameter values, or the values can be changed as required.
To change the default parameter values
- Enter a parameter value in the parameter field. (For example, to change the default value, in the Please enter the item status you wish to find type a status like DRAFT or MODERATING.)
- Click Execute Report to display the report details.
Disable generation of sub-reports
Some reports cannot be, or do not need to be, generated because they are created from the details of other reports. openEQUELLA provides a feature that facilitates the hiding of such reports. When uploading the report, checking the Hide on Generate Reports screen checkbox will conceal the report from users in the Resource Centre.
When a main report uses a sub-report, the main report passes the identity of the key item to the sub-report as a report parameter. The sub-report uses to parameter value to only display detail rows corresponding to the specified key item.
To hide the sub-report
- Create a main report and the sub-report.
- Upload the main report in the Administration Console as described in the Upload a report section.
- Upload a sub-report in the Administration Console.
- Check the Hide on Generate Reports screen checkbox to conceal the sub-report from users in the openEQUELLA Reports page. Both reports will be visible in the Administration Console.
In the openEQUELLA Resource Center
- Select Reports from the left-hand navigation menu.
- Select a report to run by clicking the report name link.
- Click OK in the dialog questioning if you are sure you want to run the report. If the main report relies on a sub-report and the sub-report has not been uploaded as a separate report, an error message will be displayed asking the user to upload the missing report.
- Select a hyperlink in the username field to display only data in the sub-report corresponding to the selected item. The result displayed is from the hidden sub-report Item Report and contains only results matching the input parameter from the selected username hyperlink.
Data sets
openEQUELLA provides multiple data sources for reporting:
- UserManagement Dataset
- JDBC Data Set
- Freetext Dataset.
The UserManagement Dataset provides access to user information kept in a system separate to openEQUELLA such as LDAP or a replicated datastore user management system.
The JDBC Data Set provides a standard interface allowing any reporting tool to create reports for openEQUELLA. The other two data sets are only available to users of the Report Designer.
The Freetext Dataset provides access to item metadata.
Any of the data sets can be selected during the Report Designer New Data Set configuration.
Freetext
The Freetext Dataset can be used to perform fast freetext queries on item metadata returning custom fields. The returned fields are artefacts created from the freetext search and do not represent any actual database structure. It is for this reason that standard reporting tools cannot query on this data set. The fields used in queries need to be indexed for power searching.
Create a Freetext Dataset
To open the New Data Set dialog
- Right-click the Data Sets folder in the Data Explorer and select New Data Set.
- Select a Data Source, and select Freetext Dataset from the Data Set Type drop-down menu.
- Enter a Data Set Name.
- Click Next to display the Free Text Query dialog.
The Freetext Dataset provides multiple Query Types and each query type is optimized for returning different metadata.
- Click Finish to display the Edit Data Set dialog.
Adding an Alias or Display Name to a column modifies the name of the columns in the preview and Report Designer interface. To modify the report columns, use the Report Designer Palette. The results of the search can also be previewed by selecting Preview Results.
- Click OK to save the data set.
The data set has been created and can now be used to return data to the report.
Freetext Query Types
The available query types are:
- Query items
- Count of items
- List files
- Matrix Search
- Matrix Count
Query items
Configuring this query type requires query text. An optional Where Clause can also be included to direct the searching. The behavior of this query type mimics an openEQUELLA Power Search.
Query Text
Any free text query such as ‘education’ or ‘Tas*’.
Where Clause
This field is optional. It is an XOQL-like query for searching on specific metadata in items.
For example, /xml/item/name like ‘Example%’ will search for items with a name child element starting with ‘Example’.
(NOTE: Each metadata path must start with ‘/xml’.)
Count of items
Count of items query type uses the same input fields as Query items but only returns a count of returned items.
List files
The List Files option returns all the files comprising items returned by the query. Column names and aliases can be configured to allow meaningful names to be substituted for the database column names.
Matrix Search
Matrix Search retrieves a list of items that contain one or more of the specified metadata schema fields. The Matrix Search only returns information from schema nodes that are indexed by the freetext search engine. The fields are entered as xml paths excluding the first ‘/xml/’ of the schema.
Matrix Count
The Matrix Count query type returns all the distinct results and a count of the number of results with these values.
Joint data set example usage
Freetext queries are commonly used in conjunction with a JDBC data set. The Report Designer provides the Joint Dataset to simplify joining data sets. Joint data sets can be created from any data sets used by the report. The joint data set provides a mechanism for joining data between the disparate query types that is equivalent to a Join clause in SQL.
This example creates a joint data set that could be used to:
- Create a report that prints custom metadata values. These values are not stored in the database and can only be retrieved using a freetext Matrix Search query.
- Create a report that returns a specific set of items. This report uses a standard data set Query items query.
To create a joint data set
- Right-click the Data Sets folder in the Data Explorer and select New Data Set.
- Select a Data Source, select Freetext Dataset for the Data Set type, and enter a value for Data Set Name.
- Click Next .
- Set the Query Type to Matrix Search.
- Add Fields entries for items on your system.
- Click Finish.
- Test the query by selecting Preview Results in the resulting Edit Data Set dialog.
- Click OK to save the data set.
- Right-click the Data Sets folder in the Data Explorer and select New Data Set.
- Select a Data Source, select JDBC Dataset for the Data Set type, and enter a value for Data Set Name.
- Click Next.
- Complete the data set configuration so the item ID, name and description are returned.
- Click Finish.
- Test the query by selecting Preview Results from the left-hand pane of the resulting Edit Data Set dialog.
- Click OK to save the data set.
- Right-click the Data Sets folder in the Data Explorer and select New Joint Data Set.
- The Joint Data Set dialog is displayed to configure the data set using the data sets created in the preceding steps.
- In the left pane, select the created freetext data set from the drop-down menu. Select Key from the resulting column list.
- In the right pane, selected the created JDBC data set from the drop-down menu. Select ID from the resulting column list.
- Select the Inner Join option from the Join Types options. Inner join only returns rows contained in both result sets. Joint queries that do not use Inner Join return a record for every item in the database, causing the joint data set to contain a record for the item whether the item was returned by the JDBC query or not.
- Enter a Data Set Name and click Finish to complete the creation of the data set.
- In the resulting Edit Data Set dialog, click Preview Results to confirm the Joint Data Set is correctly configured.
- Click OK to return to the Report Designer main page. The joint data set is now saved and can be used like any JDBC data set.
User management
Reporting on user and group information for LDAP and replicated datastore requires a special UserManagement data set, as the user management plug-ins (UMPs) store user and group information outside the openEQUELLA database.
User management data sets require a parameter to be supplied from a source outside the data set, typically a Universally Unique Identifier (UUID) from a JDBC or freetext query. This parameter is represented by the question mark (?) character.
Create a user management data set
- Right-click the Data Sets folder in the 2. Data Explorer and select New Data Set. Select a Data Source, choose UserManagement Dataset as the Data Set Type, and give the Data Set a Name.
- Click the Next button to open the User Management Query wizard.
- Select a Query Type.
- Enter a question mark (?) as the Query Text. This is usually the only query text used. The question mark is the SQL symbol for a parameter.
- Click the Finish button to complete the data set creation.
Query types
The available query types are:
- User information
- Group information
- Search users
- Search groups
- Get users in group
- Get groups for user.
User information
User information returns information for a specific user UUID. The UUID parameter is represented by a question mark (?) in the Query Text.
Group information
Group information returns information for a specific group UUID. For a generally useful data set, a question mark (?) is used.
Search users
Configuring the Search users data set is similar to configuring a User information data set. This data set Query Type also recognises an asterisk (*) wild card in the Query Text string. Entering a single asterisk returns all users
Get users in group
The Get users in group query type takes a group UUID and returns information about each user in that group. In general cases, a question mark (?) can be used in the Query Text field.
Get groups for user
The Get groups for user query type takes a user UUID and returns information about each group that the user is a member of. In general cases a question mark (?) can be used in the Query Text field.
Scenarios
The user management data set is typically used in conjunction with a JDBC data set that returns a user or group UUID as a row element. Using the user management data set provides user or group data for the combined result records, such as replacing a UUID with the user’s name.
An example user management data set scenario is a report that lists all institution items with the owner’s name.
To create this report
- Create a new report. For this example, the report has been named ‘Item owners report’.
- Create a JDBC data set to return all items created in the last week The query selects information on items from the CURRENT_INSTITUTION (a variable defined by openEQUELLA to determine which institution is being accessed) that were created in the last seven days. (NOTE: openEQUELLA also defines a CURRENT_USER variable, which provides the user ID of the user running the query.)
This particular query is written for a PostgreSQL database and uses the date_part() function that may not work in another database type. Check your database documentation for equivalent functions to evaluate dates.
- Click Finish to complete the data set creation. The data set Output Columns are displayed. Create a UserManagement Dataset that takes the owner UUID to return the owner’s user name.
- Setup a UserManagement Dataset as shown in the section above.
- Select User Information as the Query Type.
- Enter a question mark (?) as the Query Text to represent an input parameter, and click the Finish button.
- Save the data set by clicking OK.
- Click OK to the warning dialog about leaving the default parameter value empty.
- Create a table for the report with two columns and headings for Owner and Item UUID.
- Right-click the table and select Edit Data Binding from the displayed menu.
Binding the JDBC data set to the table allows use of any of the result data columns within the table, which will be required for the applying of a parameter in this example.
- Select your JDBC data set (‘Item data set’) for the Data Set, and click OK to close the dialog.
- Select the Detail Row cell under the Item UUID column heading in the report table.
- Right-click and select Data from the Insert pop-out menu to display the New Data Binding dialog.
- Click Cancel without making any changes. This has added a Data field to your table.
- Right-click the newly created Data field in the Detail Row of the Item UUID column, and select Change Data Column.
- In the resulting Select Data Binding dialog, select your JDBC data set (‘Item data set’) from the Data Set: drop-down menu, and check the box alongside the uuid field in the list of column names.
- Click OK to bind the data to the Detail Row. This will display the item UUID for each item returned by the data set.
- Select the Preview tab to view the returned results. The time taken to preview a report depends on the query and the number of records in the data set. Previews can take minutes to run.
- After viewing the preview return to the Layout tab.
To configure the item Owner column
- Right-click the Detail Row cell below the Owner column to display the cell context menu.
- Right-click and select Data from the Insert pop-out menu to display the New Data Binding dialog.
- Click Cancel without making any changes. This has added a Data field to your table.
- Right-click the newly created Data field in the Detail Row of the Owner column, and select Change Data Column.
- In the resulting Select Data Binding dialog, select your UserManagement Data Set (‘Owner username data set’) from the Data Set: drop-down menu.
The Owner column will display the item owner’s first and last names. The simplest method to generate these values is to create a new field using an expression.
To create the required field
- Click Add to add a new field.
- Replace the default Column Binding Name with ‘Owner name’.
- Select String as the Data Type.
- In the Expression field, click the Function button to open the Expression Builder.
- Select the Available Data Sets from the Category pane to display the UserManagement data set (‘Owner username dataset’) in the Sub-Category pane.
- Select the UserManagement data set (‘Owner username dataset’) to display the data set fields bound to the report table.
- Double-click the firstname then lastname fields from the list in the Double Click to insert pane to enter the expression ‘dataSetRow[“firstname”]dataSetRow[“lastname”]’.
- Add a space between the two fields using the concatenate operator ‘+’.
- Click OK to close the Expression Builder.
- Click OK to close the data binding dialog.
- Make sure the Owner field is ticked in the Select Data Binding dialog, and click OK to close it.
The Owner field now needs to be bound to a parameter to return any data. The value of the bound field is used to replace the question mark (?) operator in the User Information query.
For this example, the parameter is used to look up the name of the owner from the UserManagement data set.
To bind a data set field to the query parameter
- Ensure the newly created field is selected. 2. Select the Binding tab from the Property Editor-Data pane.
- Click the Data Set Parameter Binding button to display the Data Set Parameter Binding dialog.
- Select the Parameter entry and click Edit.
- In the resulting Edit data set parameter binding dialog, click the Function button to open the Expression Builder.
- Select the Available Column Bindings from the Category pane to display the Table element in the Sub-Category pane.
- Select the Table element to display the data set fields bound to the report table.
- Double-click the owner field from the list in the Double Click to insert pane.
- Click OK to close the Expression Builder.
- Click OK to close the Edit data set parameter binding dialog.
- Click OK to close the Data Set Parameter Binding dialog, and return to the layout page.
- Preview the report. The report is complete.
- Save the report.
Typically openEQUELLA reports would require improved formatting before being uploaded to openEQUELLA. Formatting is beyond the scope of this document, further information is available in the BIRT Report Developer Guide in the Report Designer Help.
Notes
User and Group information queries require careful implementation as each record of the JDBC data set causes a search of the User Management system. When the returned JDBC data set is large, the time to run the report can be great as each record causes a request to openEQUELLA. When openEQUELLA is using the internal user management plug-in the TLEUSER and TLEGROUP tables can be joined to improve query reporting.
Creating an openEQUELLA-Enabled BIRT Report Designer Binary
A given BIRT RD openEQUELLA release binary is comprised of a standard binary of BIRT RD, along with the openEQUELLA plugins from equella/equella-reporting-plugin. These plugins are the same plugins used in the Equella application to receive requests from BIRT RD, and to run the reports that have been added to Equella.