Java iReport工具中的分组

Java iReport工具中的分组,java,jasper-reports,grouping,ireport,Java,Jasper Reports,Grouping,Ireport,我正在使用iReport 5.1.0工具进行报表设计。 我当前的报告输出如下: ------------------------------------------------------------ | STUDENT_ID | SUBJECT_NAME | SUBJECT_MARK | STUDENT_NAME | ------------------------------------------------------------ | 1 | Maths

我正在使用iReport 5.1.0工具进行报表设计。 我当前的报告输出如下:

------------------------------------------------------------
| STUDENT_ID | SUBJECT_NAME | SUBJECT_MARK | STUDENT_NAME |
------------------------------------------------------------
|     1      |   Maths      |      25      |     John     |
------------------------------------------------------------
|     1      |   English    |      35      |     John     |
------------------------------------------------------------
|     2      |   Maths      |      30      |     James    |
------------------------------------------------------------
|     2      |   English    |      23      |     James    |
------------------------------------------------------------
但我需要像这样的东西

------------------------------------------------------------
| STUDENT_ID | SUBJECT_NAME | SUBJECT_MARK | STUDENT_NAME |
------------------------------------------------------------
|     1      |   Maths      |      25      |     John     |
             -------------------------------
|            |   English    |      35      |              |
------------------------------------------------------------
|     2      |   Maths      |      30      |     James    |
             -------------------------------
|            |   English    |      23      |              |
------------------------------------------------------------
这是我的.jrxml文件

有人能帮我吗?提前谢谢。

首先,您应该创建一个数据组

1.go to report inspector
2.right click on the jrxml name at the top of the report inpector 
3.select add report group. 
4.input the group name 
5. select the object, in your case student_id from the 'group by the following report   object'
6. click next 
7. Chose add report group header or footer or both if you want to. (in your case i think you should not add report group header or footer)
将添加您的报告组。 尝试重新生成报告。
您还应该取消选中“打印重复值”

是否可以发布jrxml文件?是否使用了数据分组?谢谢Alex..不,我没有使用数据分组。事实上,我不知道那是什么。你能发布你当前的jrxml文件吗?嗨,Alex..看我更新的问题hi@Shann谢谢,但我尝试了与你说的相同的问题..但它不起作用..在jrxml文件中这样做后..输出是一样的。如果我们需要,它只提供页眉和页脚功能..但我想删除数据重复。你应该这样做当要求时,取消选中页眉页脚。您还可以显示您的sql吗?对于数据复制,从属性中取消选中“打印重复值”。选择文本字段并取消选中属性中的打印重复值请参见屏幕截图以避免上面的重复值。是..当但当我取消选中“打印重复值”时..学生ID中第二行摸索的边框也被删除..但我希望在打印时整个组周围都有边框。我没有理解您。你能显示输出吗。如果可能的话,你想要的输出也可以。
1.go to report inspector
2.right click on the jrxml name at the top of the report inpector 
3.select add report group. 
4.input the group name 
5. select the object, in your case student_id from the 'group by the following report   object'
6. click next 
7. Chose add report group header or footer or both if you want to. (in your case i think you should not add report group header or footer)