当字段每个uniqe有两个值时,报告返回每个唯一ID的多个值 [英] Report returning multiple values per unique id when field has two values per uniqe

查看:195
本文介绍了当字段每个uniqe有两个值时,报告返回每个唯一ID的多个值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Jaspersoft iReport中有一个报告,当唯一ID在另一个字段中有多个值时会返回多行。

I have a report in Jaspersoft iReport that is returning multiple lines when a unique id has multiple values in another field.

示例输出

ID  Value
1   A
2   B
3   A
3   B

期望输出

ID  Value
1   A
2   B
3   A, B

相关XML

字段名称

<field name="ID" class="java.lang.String"/>
<field name="Value" class="java.lang.String"/>

文本元素

<textElement verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$F{ID}]]></textFieldExpression>
</textField>

<textElement verticalAlignment="Middle"/>       
<textFieldExpression><![CDATA[$F{Value}]]></textFieldExpression>
</textField>


推荐答案

想出来......供将来使用。 。

Figured it out.... For future use..

将所有内容添加到ID组标题1中,然后将值保留在详细信息1中并提供所需结果。

Added everything into an "ID" Group Header 1 then left the Value in the Detail 1 and gave the required result.

输出

ID  Value
1   A
2   B
3   A, B

这篇关于当字段每个uniqe有两个值时,报告返回每个唯一ID的多个值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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