Jasper reports 如何在Jasper中处理多个组的详细信息?

Jasper reports 如何在Jasper中处理多个组的详细信息?,jasper-reports,Jasper Reports,我有这组记录: 颜色表 color_group | color_name | color_no Primary | Red | 1 Primary | Blue | 3 Primary | Yellow | 2 Secondary | Green | 8 Secondary | Violet | 1 Secondary | Orange | 7 Others | Pink | 6

我有这组记录:

颜色表

color_group | color_name | color_no
Primary     | Red        | 1
Primary     | Blue       | 3
Primary     | Yellow     | 2
Secondary   | Green      | 8
Secondary   | Violet     | 1
Secondary   | Orange     | 7
Others      | Pink       | 6
Others      | White      | 4
Others      | Black      | 5
我想生成这样的报告

Primary
  Red        1
  Blue       3  
  Yellow     2
Secondary
  Green      8
  Violet     1
  Orange     7
Others
  Pink       6
  White      5
  Black      4

如何在jasper report中这样显示它?

这可以通过在
color\u group
字段上使用group并添加
groupHeader
条带来显示其值来解决

示例


结果


据我所知,这是在iReport中创建和使用组的过程

*Write desired query to fetch fields.
*Go to report name -> right click -> add report group -> 
 specify group name and group by object(in group-criteria) -> next ->
 add group-header and footer if needed(in details) -> finish.
*Use this group where ever necessary(by using 'print when group' expression 
 as created group).