The JasperReports IO WordPress plugin extends the WordPress REST API to act as a proxy for the TIBCO JasperReports® IO microservice engine and thus allows generating reports and visualizations that are fast, highly interactive, and seamlessly embeddable into pages and blog posts or can be exported to PDF, Excel, Word or other popular document formats.
It provides several shortcodes for embedding the reports or data visualizations into the page or blog post, for opening them in a special interactive viewer, or for including the links for directly exporting those to specific document formats.
The main configuration option needed to use the JasperReports IO WordPress plugin is the URL where the TIBCO JasperReports® IO microservice engine is running. This URL should normally be accessible only by the server hosting the WordPress instance and should not be publicly accessible from the browser (see the Security section below).
Report Embedding Shortcode
The following shortcode can be used to embed an interactive report or data visualization into a page or blog post:
The size of the embedded report container can be controlled with the width and height shortcode parameters, while the scaling behavior can be controlled using the scale shortcode parameter as seen in the following shortcode example:
[jrio report='/uri/of/the/report/in/the/jrio/repository' scale='width' width='300px']
If the JasperReports IO report or data visualization has parameters of its own, you can pass values for those using shortcode parameters having the same name as the respective report parameters.
However, since shortcode parameters are case insensitive, for camel case report parameters, a special report name mapping shortcode parameter called mappings needs to be used.
In the following example, the ChartThemesReport from the JasperReports IO repository has a parameter called chartTheme, which controls the color pallette of the chart being displayed. Notice the camel case name of the report parameter. Using a shortcode parameter with the same name should be used to pass the value of this report parameter to the JasperReports IO microservice, but it will be converted to lower case automatically by WordPress and thus would not be recognized by the reporting service.
This is why we use the mappings shortcode parameter to indicate that charttheme shortcode would correspond to the chartTheme report parameter.
[jrio report='/samples/reports/chartthemes/ChartThemesReport' chartTheme='aegean' mappings='charttheme:chartTheme']
Such report parameter mappings are not needed if the report parameters are entirely lower case.
Report Viewing Shortcode
The following shortcode can be used to include a hyperlink in the page or blog post to open the report or data visualization in a fullscreen interactive report viewer that would be displayed on top of the current browser page.
Open the report by clicking
The report viewing shortcode supports report parameters and the same parameter mapping technique as the report embedding shortcode.
Report Export Shortcode
This shortcode can be used to insert report or data visualization export links into the page or blog post.
By clicking such links, the report or data visualization would be exported into one of the supported document formats and sent to the browser as a download file.
The output shortcode parameter specifies the target export format and can be one of the following: html, pdf, xls, xlsx, docs, pptx, rtf, ods, odt, csv.
Click [jrio_export report='/report/path/in/jrio/repository' output='pdf']here[/jrio_export] to export to PDF.
When executing reports and generating data visualizations with JasperReports IO, the plugin is automatically sending some parameters behind the scenes. The so-called built-in parameters have values that are provided internally by WordPress and cannot be overridden, by specifying them in the shortcodes.
This is the list of the build-in parameters that the JasperReports IO plugin injects into every report or data visualization generated by the JasperReports IO service:
These built-in parameters can be used in reports to parametrize queries and filter information that only pertain to the current user being logged into WordPress and on whose behalf the report was executed.
The TIBCO JasperReports® IO microservice does not have a security infrastructure of its own and relies on the caller/consumer to provide it. This is why when used in combination with this WordPress plugin, the reporting microservice has to be deployed behind a firewall and not be publicly accessible from the browser.
If it were to be publicly accessible, anybody could make REST API calls to it and have reports and data visualizations delivered without requiring any credentials or security related information from the caller.
The JasperReports IO plugin offers controlled access to the TIBCO JasperReports® IO by acting like a proxy that sits between the end user and the reporting microservice and channeling through the communication between the two. By doing so, the plugin also deals with the security part by ensuring that reports and data visualizations generated from a browser session are available only to that browser session only.
It thus offers session isolation to the microservice, which does not have such functionality itself.
Basically every user of this WordPress plugin has access only to the reports and data visualizations that have themselves generated based on unique execution IDs that are available only from within the current browser session.
Starting with JasperReports IO consists of just two steps: installing and setting up the plugin.
By default, the plugin does not point to any TIBCO JasperReports® IO service instance and thus is not able to provide any reports or data visualizations through its shortcodes. You’ll have to go to the JasperReports IO settings page and point to your actual instance of the microservice, or to the public demo instance as explained in the ‘After Activation’ step!
Install JasperReports IO From Within WordPress
- Visit the plugins page within your dashboard and select ‘Add New’;
- Search for ‘JasperReports IO’;
- Activate JasperReports IO from your Plugins page;
- Go to ‘After Activation’ below.
Install JasperReports IO Manually
- Upload the ‘jasperreports-io’ folder to the /wp-content/plugins/ directory;
- Activate the JasperReports IO plugin through the ‘Plugins’ menu in WordPress;
- Go to ‘After Activation’ below.
Go to the Settings / Permalinks page and choose your default permalink structure, but make sure it is any other than the Plain option.
When you save your permalinks option, WordPress would attempt to modify your .htaccess file and if this is not writable, you’ll be instructed to modify it manually.
The JasperReports IO plugin functionality is available without the activation of pretty permalinks as explained above, but some features would not be working properly, such as the delivery of report Web fonts and the delivery of icons in the interactive report UIs.
Go to the Settings / JasperReports IO page and you’ll see that, by default, the plugin does not point to any TIBCO JasperReports® IO service instance as the JRIO Address (URL) field is blank.
You have to specify the URL of your target reporting service instance in that field and then click on the Save Changes button,
to have a fully working JasperReports IO plugin.
For easy testing and evaluation, a public demo instance of the service is available at https://demo.jaspersoft.com/jrio and you can use it in case you don’t yet have your own instance of the TIBCO JasperReports® IO microservice to point to.
To install the TIBCO JasperReports® IO microservice engine, please follow the instructions in this guide and then make sure you point to it from the pluging settings page as explained above.
If you use either the demo public instance or your own installed instance of the TIBCO JasperReports® IO microservice, you can make a quick and simple test to embed a sample report in a page or blog post using the following shortcode:
[jrio report='/samples/reports/highcharts/HighchartsChart' scale='width']
D'r binne gjin resinsjes foar dizze plugin.
Meiwurkers & amp; Untwikkelders
"JasperReports IO" is iepen boarne software. De folgjende minsken hawwe bydroegen oan dizze plugin.Meiwurkers