I'm having trouble printing following kind of structure with JasperReports Studio/DynamicJasper:
Date (1.1.2015)
-action1 (text)
-action2
.
.
.
-actionN
-image1 (image-file)
-image1 text (text)
-image2
-image2 text
.
.
.
-imageN
-imageN text
Date (2.1.2015)
-action1 (text)
-action2
.
.
.
-actionN
-image1 (image-file)
-image1 text (text)
-image2
-image2 text
.
.
.
-imageN
-imageN text
So the original idea is to print all the actions and images attached to one day, and then do the same for the next day until there are no days in the database.Basically all of this data should be printed as one report all of the described content going to detail band(s) one day after another.
Basically there can be any amount of days, and then any amount of actions and images related to each day. It would be preferred that all of this content would be printed like there was only one column: first the list of actions and then the list of images just below the actions list.
At first I was trying to implement this Jasper Studio as that was the tool I have used so far for all the other reports I have created.
Soon I realized that, this kind of structure seems not the be possible to be created with Studio, at least as far as I see it.
Problem basically is that there seems to be no way of adding dynamic amount of tables to the report created with Studio.
So that's why I started to investigate DynamicJasper.
Feel free to correct me if I'm wrong, but could this kind of structure be implemented with DynamicJasper by using DynamicJasper's subreporting capabilities?
It looks like I definitely need at least two subreport definitions if I want data to be presented like it would look like #being printed on just one column".
This is because there will be two totally different kind of datatypes printed on these columns: actions are texts and images are image files.
So basically in my DynamicJasper code I would just iterate all of my dates coming from database and create 2 subreports for each day so i would end up creating 2*(the amount of days) subreports and concatenate all of these to my reportbuilder. Does this sound like something that could work?
To be exact, I think I would print the description texts of the images on adjacent column next to images just to make things easier....
In general the solution is this: "in order to print report element(s) in a loop any amount of times in one report, place the element(s) to the detail band of the report and jasper will automatically print this set of elements as many times as there are beans in the collection passed for the report as main datasource/dataAdapter."