Subreport to trigger based on current result set

Hello All,

I have a subreprot that is passed a paramater from the main report, I will cal it "ID". In the main report I have a query to select say 10 IDs.

When I run the report I get the 10 different IDs and 10 subreports. However the subreport only triggers on the very first ID (thus I have 9 subreorts with the same info). How can I get it to trigger on each ID like in the main report?

 

Thanks in advance!

Java_Jasper's picture
Joined: Jan 17 2012 - 10:13am
Last seen: 7 years 6 months ago

3 Answers:

Hello all,

So after trying for some time to figure this problem out here is the solution that worked for me.

  1. I made sure I was calling said IDs in my sql.
  2. In order to make my IDs trigger for each iteration of the report I used several "Group Headers" I did this because the headers are evaluated once per cycle per-say.
  3. I then placed a sub report into the footer of said report and passed it the "Field" which is $F{ID}, thus when the sql is called upon it gives the ID found at that moment in time to the sub report.
  4. The end result is a sub report that triggers, every time the header is evaluated.

I know this is a bit of a hack but ENJOY!

Java_Jasper's picture
Joined: Jan 17 2012 - 10:13am
Last seen: 7 years 6 months ago

when u put ur subreport on Detail, main report will send IDs. If u done this u  can see 10 subreports.

gocmenally's picture
Joined: Oct 3 2013 - 1:14am
Last seen: 9 years 8 months ago

Hello,

I have a section already in the detail section, where info is printed. When I have said data print it becomes fractured. Thus (data --> Sub Report) is printed over and over not the desired result.

Thx.

Java_Jasper - 9 years 8 months ago

do u put the subreport in detail band of main report?

hishamkmr's picture
796
Joined: Sep 4 2013 - 5:07am
Last seen: 9 years 1 month ago

Please see above.

Java_Jasper - 9 years 8 months ago
Feedback