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

calculating a percent of the total for each detail row


itchytoes

Recommended Posts

HI all --

I searched for "percent of total" in the forums as well similar phrases and could not find out how to do this.

I tried many things, and figured that I should be able to make it work.

I just have some detail rows, each with a field called "count". 

I can compute a variable called "totalCount",  but I want to display the count as a percentage of totalCount for each detail row.

I've tried various incarnations of evaluationTime for the percentage text field, but nothing works.  If I set it to "Group",  I get the percentage as the value based on count of the last detail row for all my rows.

Using "Auto" does not help, although  saw postings that said to use "Auto".

Am I missing something  or doing something stooopid?    (After all these years of working with JasperReports, I don't think I've ever tried to do this one thing).   

Thanks

Betty

Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

Hi -- thanks for responding, and for your excellent tutorial.

 

I followed the simple JasperReports method of using the "Auto" and I got it working. Oddly enough, I had problems with it when I tried doing it that way earlier. Something was different, but I'm not sure what. At any rate, I'm good for now

 

 

Link to comment
Share on other sites

  • 4 years later...
  • 2 years later...

Very useful, but one crucial bit of information is missing from the "subreport-method": The sum variable in the main report has to have its Calculation set to "System" - cost me a few hours of desperation.

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...