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

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


balram.deswal_1

Recommended Posts

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

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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