balram.deswal_1 Posted May 16, 2017 Share Posted May 16, 2017 Hi Team, I am creating a report in Jasper Studio. In that report, I need to calculate the percentage as follows: (Count of rows where value of a column is 100)/(Count of all rows)*100 depending on filter of date. For this, I have created a main report with a dummy query which is returning only one row and passing the date parameter to the subreport. In that subreport, I have added the query somewhat like: select count(*) as overall_value, Table1.dept as department_name from Table2 INNER JOIN Table1 ON Table2.table_id=Table1.table_id where Table2.date_value>=$P!{p_finalstartdate} and Table2.date_value<=$P!{p_finalenddate} group by Table1.dept I am passing this overall_value and department_name as parameter to the table added in the detail band of the same sub-report with the query as follows: select count(*) as available_value, Table1.target as department_name from Table2 INNER JOIN Table1 ON Table2.table_id=Table1.table_id where Table2.samplevalue=100.00 and Table2.date_value>=$P!{p_t_finalstartdate} and Table2.date_value<=$P!{p_t_finalenddate} group by Table2.target having target='$P!{p_t_target_name}' Now in the output, it is showing the percentage values in the tabular format, but it is showing the table for each department (with its percentage value) instead of a single table. If I put this table in summary band, it is showing the percentage of only last department in the table. How it can be done in this case that it will show the complete data in the single table for all departments? Kindly provide your valuable suggestions. Regards, Balram Singh Deswal Link to comment Share on other sites More sharing options...
balram.deswal_1 Posted May 17, 2017 Author Share Posted May 17, 2017 Hi Team, Kindly provide the solution for the above issue.Regards,Balram 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