Jasper reports 如何在jasper report上显示不同的图片?

Jasper reports 如何在jasper report上显示不同的图片?,jasper-reports,Jasper Reports,我有一个问题,在这种情况下,当试图显示“工作卡”中的三个独立图像时,会显示相同的图片 但实际上db上有三个不同的图像 这是我的SQL: select distinct job_card.job_card_name, job_card.job_number, job_card.job_type, job_card.job_card_name, client_account.account_name, job_card.punchlist_comments, "user"

我有一个问题,在这种情况下,当试图显示“工作卡”中的三个独立图像时,会显示相同的图片

但实际上db上有三个不同的图像

这是我的SQL:

    select distinct job_card.job_card_name,
job_card.job_number,
job_card.job_type,
job_card.job_card_name,
client_account.account_name,
job_card.punchlist_comments,
"user".name,
job_card.customer_name,
job_card.created_at,
job_card.customer_signature_blob,
job_card.technician_signature_blob,
photograph.photo_blob
from $P!{schemaName}.job_card
left join $P!{schemaName}.photograph on $P!{schemaName}.job_card."_id_" = $P!{schemaName}.photograph.job_cards_fk
left join $P!{schemaName}."user" on $P!{schemaName}."user"."_id_" = $P!{schemaName}.job_card.technicians_fk
left join $P!{schemaName}.asset on $P!{schemaName}.asset."_id_" = $P!{schemaName}.job_card.assets_fk
left join $P!{schemaName}.client_account on $P!{schemaName}.client_account."_id_" = $P!{schemaName}.asset.clientaccounts_fk
where job_card._id_ = $P{job_cardUUID}::uuid
“photo.photo_blob”是变量

这就是jasper元素:

<textElement verticalAlignment="Middle">
                                <font isBold="true"/>
                            </textElement>
                            <text><![CDATA[ Installation pictures ]]></text>
                        </staticText>
                        <image>
                            <reportElement x="0" y="180" width="200" height="124" uuid="8bf21ae9-eec4-4c39-b4c1-4c174ec59aab"/>
                            <box>
                                <pen lineWidth="0.25"/>
                            </box>
                            <imageExpression><![CDATA[$F{photo_blob}]]></imageExpression>
                        </image>
                        <image>
                            <reportElement x="200" y="180" width="200" height="124" uuid="aa9d55fb-184f-4098-95f8-9de17530c99b"/>
                            <box>
                                <pen lineWidth="0.25"/>
                            </box>
                            <imageExpression><![CDATA[$F{photo_blob}]]></imageExpression>
                        </image>
                        <image>
                            <reportElement x="400" y="180" width="150" height="124" uuid="64df2d59-4154-4b26-a3d1-3f54f1b54eca"/>
                            <box>
                                <pen lineWidth="0.25"/>
                            </box>
                            <imageExpression><![CDATA[$F{photo_blob}]]></imageExpression>
                        </image>


我尝试将此框放在“细节”栏中,但页面只会乘以图片的数量

您有三张重复的图片,因为您在同一个栏中同时使用三个图像元素,共享相同的表达式,即
$F{photo\u blob}

如果每个
工作卡都有一个或多个不同的图片。\u id
您必须创建一个组,例如
工作卡
,并在组标题中放置

<text><![CDATA[ Installation pictures ]]></text>

在你放的细节带上

<image>
    <reportElement x="0" y="180" width="200" height="124" uuid="8bf21ae9-eec4-4c39-b4c1-4c174ec59aab"/>
    <box>
        <pen lineWidth="0.25"/>
    </box>
    <imageExpression><![CDATA[$F{photo_blob}]]></imageExpression>
</image>


Duplicates&这会将页面乘以数据库中的图片数量。是否看到任何重复?同一张工作卡有不同的图片吗?在其余数据的下方有不同的id?如果您说是,那么您的路径是正确的,只需使报表按水平顺序打印,并添加更多列。如