3

データに合わせてテキスト フィールドを引き伸ばすにはどうすればよいですか。データがバンドの高さを超える場合、テキスト フィールドは引き伸ばされません。jrxmlにテキストフィールドタグを追加しました...

例:

<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
    <reportElement
                    style="dNew"
                    mode="Opaque"
                    x="200"
                    y="0"
                    width="200"
                    height="19"
                    key="value-2"
                    stretchType="RelativeToTallestObject"
                    positionType="Float"
                    isPrintInFirstWholeBand="true"
                    isPrintWhenDetailOverflows="true"/>
    <box></box>
    <textElement textAlignment="Center" verticalAlignment="Top">
        <font fontName="Arial" pdfFontName="Helvetica"/>
    </textElement>
    <textFieldExpression   class="java.lang.String"><![CDATA[$F{DATA2}]]></textFieldExpression>
</textField>
4

1 に答える 1

3

一部のバンドは伸びませんが、詳細バンドについて話している場合は、次のようにすることができます。

<textField isStretchWithOverflow="true" isBlankWhenNull="true">
    <reportElement style="base" positionType="Float" 
       isPrintRepeatedValues="false" x="0" y="3" 
       width="380" height="26" isRemoveLineWhenBlank="true"/>
    <textElement/>
    <textFieldExpression class="java.lang.String">
       <![CDATA[$P{information}]]></textFieldExpression>
</textField>

これは自動生成された XML から貼り付けられているため、余分なものがたくさんありますが、 isStretchWithOverflow="true" が機能するはずです。これにより、テキストがいっぱいになると、フィールドが下に伸びます。

私は通常 iReport を使用してレポートを作成しますが、静かに動作します。そこでも XML ビューに切り替えることができます。

于 2009-12-23T23:52:14.287 に答える