Creating a Custom Report with Jaspersoft Studio

Learn how to create a Custom Report with Jaspersoft Studio for use in Opsview Cloud

Jaspersoft Studio Support

Opsview Reporting Module currently supports the use of Jaspersoft Studio v6.11.0 - v6.19.0. Other versions may work but are not officially supported.

Jaspersoft Studio Documentation

Help regarding using Jaspersoft Studio is available at Jaspersoft Studio Documentation.

Install of Jasper Studio Software

674674

Windows/Linux

https://community.jaspersoft.com/project/jaspersoft-studio/releases

Use all the default settings when installing the Studio.

Jaspersoft Studio Connections to Opsview Reporting Module

The only connection required to be setup is the connection from the Jasper Studio software to the Jasperserver Reports module running within Opsview.

Create Jasper Studio Connection to Jasperserver Reports

  1. Open Jasper Studio and you should see the following screen.
14461446
  1. Right click on the ‘Server’ on the left hand pane and select ‘Create JasperReports Server Connection’
14361436
  1. Populate the proceeding screen with your details. The username will be a valid user defined within Opsview UI, it has to have the correct Report role permissions (REPORTADMIN). Click the ‘Finish’ button once complete.
690690

📘

At this point, you may be asked to trust the server certificate if using the Opsview self-signed generated certificates.

  1. Once complete a ‘Successful’ message will be displayed. There will now be some folders and files under the connection that was just defined.
14361436
  1. All possible connections are now in place to use Jasper Studio with Jasperserver Reports.

Running an Existing Report from Jasper Studio

  1. Within your Jasper Studio Jasperserver Connection navigate to Reports → Daily Availability Report as an example and right click the folder and from the menu select 'Run Report Unit'
14371437
  1. Fill in the required details for this report, ie Report End Date and Hashtag. Keep the dropdown set to the default HTML. Click the green ‘Run the report' button.
    NOTE: an error will be seen, just click OK to get past this.
14381438
  1. After the error disappears click the icon to the right of the url field, ‘Open the report in the external browser’. This will launch the browser and point at the url where the report output has been produced. Note the HTML option can be changed to PDF and this will open locally on your machine as a pdf file.
14661466

Modifying an Existing Report

In this example the Daily Availability Report will be cloned and the cloned modified to suit our needs.

  1. Right click on the ‘Daily Availability Report’ folder and select copy from the menu. In this example we are going to call ot ‘DailyAvailabilty_mod’.
14321432
  1. Our example report contains 3 reports, a) a main report (Daily Availability) which handles the formatting of the front cover and input parameters, b) a bar chart (DailyAvailabiltySummaryChartByKeyword) and c) a summary table (DailyAvailabiltySummaryTableByKeyword).
    Right click the first report of the 3 and select ‘Edit in Editor’.

  2. The middle pane in Jasper Studio will now show detail of the reports front cover. Also notice in the middle pane near the bottom left 3 tabs, Design, Source and Preview. The Design is the the default setting, clicking the Source shows the Jasper reports code.
    The first minor change we can make is renaming the displayed report name, he we have edited it to say ‘Daily Availability Report - Mod'

19181918
  1. After the change has been made navigate to File → Save. A prompt will appear asking if this should be ‘published’ to JasperReports, select ‘Yes’ as you can only run reports which have been published.

  2. Now run the report and your change should be seen in the final output.

Modify an Existing Reports Database Query

Here we will look at modify the actual mysql query used to create part of the availability report.

  1. Edit the ‘DailyAvailabiltySummaryChartByKeyword’ and select the Source tab from the middle pane.
    The mysql query will be contained within the element.
14951495
  1. The Query in this example is as followed.
946946
  1. As this is a daily report part of the query uses the supplied end date and goes back 1 day (- INTERVAL 1 DAY). Lets modify this to a weekly report by changing the 1 to a 7. A similar change also need to be applied to the DailyAvailabiltySummaryTableByKeyword report.

  2. Save, publish the changes and run the report.

Notes on using Jaspersoft Studio

Permissions

Opsview User accounts with the REPORTUSER permission will be able to view a subset of the available resources when logged in via Jaspersoft Studio. This is read-only - they will be unable to publish changes.

Opsview User accounts with the REPORTADMIN permission will be able to view all available resources when logged in via Jaspersoft Studio, as well as publish changes into the Opsview Reporting Module.

Session Manager Configuration

Jaspersoft Studio will use additional sessions when making connections, which can cause the Session Manager to hit the max open sessions limit. To prevent this, we recommend increasing your max open sessions limit - see Login Session Limits for instructions. We recommend increasing your max open sessions limit by at least 2 for every individual Jaspersoft Studio client you plan to use.

Publishing reports or repeatedly using the “Test Connection” option will create a new session every time and quickly hit the limit. By default, idle sessions will timeout after 1 hour.

Open in Browser options

Several Jaspersoft Studio context menus under the Opsview Reporting Module connection have the option to “Open in Browser”. These will attempt to log in as the user who most recently logged into the Opsview UI itself in the browser used, not the user currently logged in to Jaspersoft Studio. To switch users if desired, simply switch users within the Opsview UI and retry the “Open in Browser” option. You can view the current active user in the top right of the page.

If you see a 401 response when “Open in Browser” is used, relog into your account via the Opsview UI and retry.

Running Reports

Running reports within the Jaspersoft Studio IDE is not currently supported. If you attempt to do so, you will see the following error message:

745745

Instead, click the “Open the report in the external browser” icon to run the report:

929929

Troubleshooting

See the general reports troubleshooting page at Troubleshooting Reports.

Resources

Jaspersoft Studio User Guide

ODW Relationship Diagram