Is it possible to display the group summary with growing columns?

I have a jasper report with the salary details of all the employees within a company grouped by departments. Now I need to display the group summary. The summary table should look like.
                                                        FINANCE                                  IT              HR       PlANNING      ...              ...             TOTAL
BASIC                                            (Total basic in finance dept)
HRA                                                (Total HRA in finance dept)
TOTAL                                          (Total Salary in finance dept)

The salary components displayed as rows in the report remain fixed (means there will be always four rows in every report)   where as the department number varies from report to report (This means for one report there can be five departments and in some reports there can be 2 departments). I am searching for a generalized approach to solve this. I could generate the report with  departments appearing as rows and salary components appearing as columns. But the report format requirement ia as shown above. Also tried using crosstabs but could not achieve this. Please help me with this issue.



ammumariyam's picture
Joined: Mar 19 2018 - 10:37pm
Last seen: 5 years 5 months ago

1 Answer:

Hi mariyam,

You can achieve this using UNION in your SQL query, i.e.

Get deparment count for BASIC


Get deparment count for HRA




Hope this helps.

m.kamran's picture
Joined: Nov 3 2017 - 3:11am
Last seen: 5 years 4 months ago