Create a row grouping in Table Component (Jasper)
Consider an example currently you are showing the data as shown in below using tabular component.
Make data easy with Helical Insight.
Helical Insight is world’s best open source business intelligence tool.
Example:
State | Person Name | Tax Amount |
---|---|---|
Iowa | PQR | 10,000 |
Iowa | XYZ | 15,248 |
Utah | ABC | 14,245 |
Utah | DEF | 13,256 |
Wisconsin | GHI | 12,789 |
Wisconsin | JKL | 11,100 |
But If you want to show the data as shown in the table.
State | Person Name | Tax Amount |
---|---|---|
Iowa | ||
PQR | 10,000 | |
XYZ | 15,248 | |
Total | 25,248 | |
Utah | ||
ABC | 14,245 | |
DEF | 13,256 | |
Total | 27,501 | |
Wisconsin | ||
GHI | 12,789 | |
JKL | 11,100 | |
Total | 23,889 |
For this you need to follow these simple steps.
-
- Create a group in the Groups property of data set (This data set is used by table component).
Say Country is the name of the group and then put the expression.
- Create a group in the Groups property of data set (This data set is used by table component).
Note : Sometime in the Jasper Studio 6.0.1 the name of the group does not change in that case you need to keep the by default name to the group.
-
- After creating the Group you can see the two new bands added to table component. You can see in the figure.
- Create a cell in Group header and put group expression in it (in my case $F{country}).
- In order to calculate the total group wise you need to create a variable with reset type your group name (Country) otherwise you will not get the correct result.
- Put this variable (say total) in the group footer.
Make data easy with Helical Insight.
Helical Insight is world’s best open source business intelligence tool.
Note: You can create multiple group in a table.
Best Open Source Business Intelligence Software Helical Insight is Here
I have tried,but on generation of report its showing null value.