如何在列中隐藏重复值 [英] How to hide duplicates values in column

查看:130
本文介绍了如何在列中隐藏重复值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在sql中有2个表 table_a table_b 这是输出:( 1对多关系)

I have 2 tables in sql table_a and table_b this is the output: (1 to many relationship)

table_a                    table_b
id_no (pk)  name            id_no (fk)      id_tabl(pk)     order_code     order_item
1            a                1                 1              11              aple
1            a                1                 2              12              orange
1            a                1                 3              13              ice
2            b                2                 4              12              orange
2            b                2                 5              13              ice
3            c                3                 6              13              ice
3            c                3                 7              12              orange
3            c                3                 8              11              aple

我想只显示1个名字,所有 order_item

I want to display only 1 name with all his order_item.

如何使用 iReport 在xml中?

How can I display it using iReport in the xml?

输出样本:

id_no      name    order_item
1           a       aple
                    orange
                    ice
2           b       orange
                    ice
3            c       ice
                    orange
                    aple

仅使用2( order_item )我的发票的每个页面中的字段模式
其他显示将显示在发票页面2中。

Using only 2 (order_item) field pattern in every pages of my invoice the other display will be displayed in invoice pages 2.

推荐答案

您应该使用数据分组

你可以阅读本文关于数据分组。

You can read this article about data grouping.


  • 您可以使用如下查询:

SELECT table_a.id_no, table_a.name, table_b.order_item FROM table_a, table_b WHERE table_a.id_no=table_b.id_no ORDER BY table_a.name

注意:可能需要按 <$ c添加排序$ c> table_a.id_no 列。

Note: may be you need to add sort by table_a.id_no column.


  • 你应该创建 iReport 名称组 字段

注意:可能需要创建两个组 - id_no name 字段。

Note: may be you need to create two groups - for id_no and name fields.


  • 您可以使用详细信息用于绘制数据行的波段。或者您可以将所有 textField 元素放入 Detail 区域。在这种情况下,您应该将 false 值设置为 isPrintRepeatedValues textField 的属性(对于 id_no 名称 字段)。

  • You can use the Group and Details bands for drawing the data row. Or you can put all textField elements to the Detail band. In this case you should set false value to the isPrintRepeatedValues textField's property (for id_no and name fields).

这篇关于如何在列中隐藏重复值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆