In this article I would like to share with you a practical sample of the
report and subreport that uses JSON data source.
This sample was tested and worked with JasperSoft Studio 6.1.
The test report contains:
- main report
- sub report
- data adapter that describes json file
- json file that is used to provide data for both reports
To run this report (in JasperSoft Studio 6.1):
open the Data Adapter file (in our case People.xml) and update
the path to the file that contains JSON data in your environment
(people.json). Please refer to the screenshot below:
import updated People.xml data adapter to JasperSoft Studio.
To do this I would suggest that you should place this file
to your Studio’s workspace and then import it to Studio.
Please see the screenshot below:
please check that the Data Adapter that was just imported
uses a valid path to the physical file with JSON data and can
find it:
define a data adapter for this report.
To do this please select the data adapter that has been created
on the previous step:
After this you can run the report.
I hope that this article would allow you to do your first steps with
JasperSoft Studio and report/sub report based JSON solution.
P.S.: many thanks to Tom Chen who shared with me this sample.
Recommended Comments
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now