drummer54 Posted April 30, 2014 Share Posted April 30, 2014 I'm at my wits' end over this. I've created a table in JasperSoft Studio with subtotals on region and company. The detail data from the database contains, by location (the hierarchy is company / region / location), values for number of employees, total number of compliance events for all employees for that location, number of events that are in compliance, number of events not in compliance, and percent in compliance. For example, the first location has 40 employees, 1793 total events, 1760 events in compliance and 33 events not in compliance. That results in a compliance percent of 98% after rounding, 1760 / 1793. All of this data is returned by the database query. The problem I'm having is in computing region and company percents. I have to sum the events in compliance and the events not in compliance across region and company levels and then perform the calculation to get the percent in compliance for each region and the company as a whole. How is this done? Everything I've tried either results in 0 for the percent or an "Error evaluating expression". Link to comment Share on other sites More sharing options...
sadakar Posted May 2, 2014 Share Posted May 2, 2014 Can you provide a sample JRXML file ? Did you try calculating using variables in iReport ? Link to comment Share on other sites More sharing options...
drummer54 Posted May 6, 2014 Author Share Posted May 6, 2014 I've uploaded the latest JRXML file, the latest of several attempts. This one doesn't produce an error but it returns 0 for the calculated percent. The variable mth1_individual is where the percent is being calculated as the result of (mth1_compliant / (mth1_compliant + mth1_noncompliant)) * 100 Link to comment Share on other sites More sharing options...
drummer54 Posted May 6, 2014 Author Share Posted May 6, 2014 By the way, this is in JasperSoft Studio 5.5.2 Link to comment Share on other sites More sharing options...
sadakar Posted May 6, 2014 Share Posted May 6, 2014 can not copy paste the code .. can you copy paste the code in text file and upload so that I can download and test ? Link to comment Share on other sites More sharing options...
drummer54 Posted May 6, 2014 Author Share Posted May 6, 2014 I created jrxml.txt and uploaded it. Thanks. Link to comment Share on other sites More sharing options...
drummer54 Posted May 8, 2014 Author Share Posted May 8, 2014 I finally figured out how to do this, but it certainly wasn't intuitive and not something I ever found documented anywhere. Link to comment Share on other sites More sharing options...
drummer54 Posted May 9, 2014 Author Share Posted May 9, 2014 I discovered this morning that none of my subtotals is working properly. If I run the report for a single region within a company the totals are correct, but if I run it for multiple regions in a company the simplest grouping becomes accumulative. In other words, for example, the employee head count for region 1 is correct but for region 2 is the accumulation of regions 1 and 2, region 3 is the accumulation of regions 1, 2 and 3 and so on. And the percent column is simply the first region percent and never gets updated. I can't believe how unintuitive and poorly documented this application is. Link to comment Share on other sites More sharing options...
drummer54 Posted May 23, 2014 Author Share Posted May 23, 2014 No one knows how to get this to work? I'm still having this problem and see no way around it. I might have to report it as a bug, because I've created groups and shouldn't those group footers provide subtotals for that group rather than a running total? It's not the kind of thing I should have to jump through hoops to get to work. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now