Create custom reports with Jaspersoft Studio

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

Overview Copied

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.

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

Install of Jasper Studio Software Copied

For Windows and Linux, use all the default settings when installing the Studio.

Jaspersoft Studio Connections to Opsview Reporting Module Copied

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 Copied

  1. Open Jasper Studio and you should see the following screen.

Jasper Studio screen

  1. Right click on the ‘Server’ on the left hand pane and select ‘Create JasperReports Server Connection’.
  2. 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.

JasperReports configuration

Note

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.

Running an existing Report from Jasper Studio Copied

  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’.

Run Report Unit

  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

The system will display an error message. Please click OK to resolve the issue.

Configure Run Report Unit

  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.

Open the report in the external browser

Modifying an existing Report Copied

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.
  2. 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’.
  3. 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'

Edit Daily Availability Report

  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 existing Reports Database Query Copied

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.

Edit Daily Availability Summary Chart

  1. The Query in this example is as followed.

Sample Query

  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 to publish the changes, and then run the report.

Notes on using Jaspersoft Studio Copied

Permissions Copied

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 Copied

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 Copied

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 Copied

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

Error message

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

“Open the report in the external browser”

Troubleshooting Copied

See the general reports troubleshooting page at Troubleshooting Reports.

["Opsview"] ["User Guide"]

Was this topic helpful?