Grouping in Jasper Report/Table

Grouping in a canned report which can be developed in Jasper Studio is easily done in Cross-tab. Cross-tab can be used when a measure has to be calculated on more than one dimension and in that case it is simpler to use cross-tab. Limitation of using Cross-tab is that it has fixed lay-out and customization of look and feel gets complex. One can use grouping available in reports and tables in special cases like.

1. Displaying the groups in new page every time
2. when Header/ Footers need customization

Grouping in table


1.Right click on the dataset and click on add group

Capture1


Capture2

2. create variables and store calculated measure by aggregating(sum, count, etc…,) and set the property to ResetType as the Group created.

Capture3

3. Add row in the Group Header of the table.

Capture4

If required we can group the cells and make a single cell of the group as shown in the following

Capture5

4. Add row in the Group Footer of the table, drag and drop the variables in to respective cells.

Capture6

Grouping in Report


1.Right click on the report and click on add group, create group by giving the expression or selecting the fields.
NOTE: fields must be pulled in the main dataset query

Capture7

Capture10

2. create variables and store calculated measure by aggregating(sum, count, etc…,) and set the property to ResetType as the page.

Capture8


3. Add row in the Group Footer of the table, drag and drop the variables in to respective cells.

Capture9

Displaying the groups in new page every time

1. add the table into Page Header

Capture11

2. Set the property Start New Page

Capture12

Leave a Reply