Create custom reports with Jaspersoft Studio
Learn how to create a Custom Report with Jaspersoft Studio for use in Opsview Monitor
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.
For Windows and Linux, use all the default settings when installing the Studio.
The only connection required to be setup is the connection from the Jasper Studio software to the Jasperserver Reports module running within Opsview.
- Open Jasper Studio and you should see the following screen.
- Right click on the ‘Server’ on the left hand pane and select ‘Create JasperReports Server Connection’.
- 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.
NoteAt this point, you may be asked to trust the server certificate if using the Opsview self-signed generated certificates.
- Once complete a ‘Successful’ message will be displayed. There will now be some folders and files under the connection that was just defined.
- 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’.
- 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.
NoteThe system will display an error message. Please click OK to resolve the issue.
- 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.
In this example the Daily Availability Report will be cloned and the cloned modified to suit our needs.
- Right click on the Daily Availability Report folder and select copy from the menu. In this example we are going to call ot
- 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’.
- 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'
- 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.
- Now run the report and your change should be seen in the final output.
Here we will look at modify the actual mysql query used to create part of the availability report.
- Edit the
DailyAvailabiltySummaryChartByKeywordand select the Source tab from the middle pane. The mysql query will be contained within the element.
- The Query in this example is as followed.
- 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.
- Save to publish the changes, and then run the report.
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.
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.
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 within the Jaspersoft Studio IDE is not currently supported. If you attempt to do so, you will see the following error message:
Instead, click the “Open the report in the external browser” icon to run the report:
See the general reports troubleshooting page at Troubleshooting Reports.