Jasper Reports newbie here...
In a nutshell, what I am looking to do is have a Jasper Report that uses json as a data source, that is passed to it at execution time, via the REST API.
In more detail... The json data would come from my ERP system and would be sent to the Jasper Server as part of the web request to run the report. The output in general would be PDF, but sometimes Excel, CSV, or HTML depending on the report and the needs of the user. What are the high-level steps to do this, and can you point me in the direction of the documentation that covers each step?
I have created a Jasper Report in Jaspersoft Studio, that uses a json file as its datasource via a DataAdapter. I have the Jasper Server installed and running as a Docker instance against a Mariadb cluster. Now I just need to connect the dots. The Jasper Reports server would not have direct access to the ERP system database, hence using Jasper as a web service and passing it the data I want to use in the report. Program language doesn't matter per se, but C# or Visual Basic examples would be ideal. I understand the basic concept of sending a POST request to run the report, but I don't see a way in the API that you can pass the report the data to use during execution.
Thanks in advance for any assistance anyone can provide!
-Tim
1 Answer:
First you should get somehow familiar with the REST API that is described here: https://community.jaspersoft.com/documentation/tibco-jasperreports-serve...
Based on that API, there is this Java client created by Jaspersoft: https://github.com/Jaspersoft/jrs-rest-java-client. The Readme there covers a lot of topics.
If you're not into a Java-based solution you could use the API directly. My answer here: https://stackoverflow.com/a/37441567/5882963 covers a similar topic to yours but starts off with how to pass XML data to sample report and then how to modify the report in order to pass JSON data.
As an update, and so hopefully Googlers can find a decent example to get themselves going, here is some example VB.Net code that works:
Replace the values between "<Variable>" with your specific implementation configuration. As narcism mentioned, his answer, contains the information you need to setup the JasperReports jrxml file to use json as an inputControl /parameter to the report.