I'm not 100% sure how to word this question, but basically what I'm trying to do is create a loop that can take a list of n number of items (in my case the parameters are barcode numbers) and pass those 1 by 1 as parameters to other reports in the Jasper Server, generating a PDF file for each one. For example, if I have 100 barcode numbers, I want to create 100 PDFs with a single REST call, and export them to a local folder. Is this possible?
I would suggest
create a jrxml with a subreport in it.
- Main report should accept some arraylist as parameter
- Group based on each arraylist value
- in the group bands, create a subreport (which is your actual pdf layout)
when you make a rest call, send the parameter and generate multiple page pdf and
then write some code to split multiple page pdf to single page pdf
Thank you for the responses. I ended up using a similar approach that reportdev suggested. Instead of using an ArrayList parameter, I just used a SQL query to find the parameter values I was looking for and passed those to a subreport in a report group to split them up. I couldn't get them all on separate PDFs though, they're all in one.