Jump to content
We've recently updated our Privacy Statement, available here ×

ReportGroup count variable only in group footer?


pawel_r

Recommended Posts

Hi

I put my report data into ReportGroup and I wanted to have short summary about number of records of each category(in group) at the end of the report. However, at the end of report (Summary) I got only single result, not all data. After a few tries I noticed that the only place where this variable works fine is ReportGroupFooter  - in all other places I got empty fields or only single result insted of all.

Is there any solution? The only thing that comes to my mind is subreport, but I haven't tried it yet and don't catch how it exactly is supposed to work (grouping reports? getting data from more than one dataset?)

 

Regards

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Hi,

 

If you have 10 categories in your report (10 group ruptures), it means you have 10 items to display in the summary.

Not just one.

How do you plan to gather these 10 values? Have done anything about it, or do you expect the engine to keep lists of values for you?

 

I think you need to use the scriptlet functionality of JasperReports to accumulate these 10 values in a java.util.Collection or some other data structure of your own. In order to display the 10 items/values, you need to iterate through them and in JasperReports, the only way to iterate through data is to use a subreport or a list component.

We have samples for scriptlets, list component and subreport in the /demo/samples folder of the JR project distribution.

 

I hope this helps.
Teodor

 

Link to comment
Share on other sites

teodord
Wrote:

How do you plan to gather these 10 values? Have done anything about it, or do you expect the engine to keep lists of values for you?

Well, yes, actually I thought tha engine generates all nedded data before displaying first page (title section) and keeps it till it generates the very whole report (including summary). Thanks for making me realize that I am wrong :)

 

And yes, your answer helped me a lot (I saw examples in /demo section before, however I didn't think that scriplets could be a help in my problem)

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...