I have a field with values:
CM45024,CM45025,CM45026
I want to separate this into multiple items using subreport. My jrxml source is:
This is how it can be achieved using subreport, assuming that your $F{docIdNoGRN}
contains the String "CM45024,CM45025,CM45026"
Generate the data source that will be passed to the subreport
As you can see I split(",")
your field String
getting an Array
that is converted to List
and then passed in a JRBeanCollectionDataSource
example: (your_subreport.jrxml):
I have added the $V{REPORT_COUNT}
to achieve the numbers (1,2,3) .
The output will be
1 CM45024
2 CM45025
3 CM45026
Note: You can also use the jr:table component to achieve this if you like to avoid generating a subreport (just define the table datasource as above)