如何在Jasper报表中设置列的背景颜色

huangapple go评论85阅读模式
英文:

How to set background color of a column in Jasper Report

问题

<staticText>
    <reportElement x="100" y="0" width="100" height="25" backcolor="#A6A6A6" />
    <box>
        <topPen lineWidth="1.0"/>
        <leftPen lineWidth="1.0"/>
        <bottomPen lineWidth="1.0"/>
        <rightPen lineWidth="1.0"/>
    </box>
    <textElement textAlignment="Center"/>
    <text><![CDATA[Nom]]></text>
</staticText>

需要更改背景颜色,我尝试了属性 backcolor="#A6A6A6" 但它不起作用!

英文:
 <staticText>
       <reportElement x="100" y="0" width="100" height="25" backcolor="#A6A6A6" />
                <box>

                    <topPen lineWidth="1.0"/>
                    <leftPen lineWidth="1.0"/>
                    <bottomPen lineWidth="1.0"/>
                    <rightPen lineWidth="1.0"/>

                </box>
      <textElement textAlignment="Center"/>

     <text><![CDATA[Nom]]></text>
</staticText>


I need to change the background color, i tried the attribute " backcolor="#A6A6A6" " but it it doesn't work!

答案1

得分: 1

你还需要设置 mode="Opaque"

英文:

You also need to set mode="Opaque".

huangapple
  • 本文由 发表于 2023年2月8日 23:54:27
  • 转载请务必保留本文链接:https://go.coder-hub.com/75388376.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定