Table Getting Repeated in Detail Band & Showing Last Row (if in Summary Band)

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



Balram Singh Deswal

balram.deswal_1's picture
Joined: May 16 2017 - 12:33am
Last seen: 5 years 9 months ago

Hi Team,


Kindly provide the solution for the above issue.



balram.deswal_1 - 6 years 4 months ago

0 Answers:

No answers yet