6

I use iReport 5.5.0. How to center align a barcode component?

Relevant fragment of my jrxml is below.

        <componentElement>
            <reportElement x="0" y="9" width="113" height="36" uuid="a11badb4-7c31-4011-83ae-f287b457939a"/>
            <jr:Code128 xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd" textPosition="bottom">
                <jr:codeExpression><![CDATA[$F{number}]]></jr:codeExpression>
            </jr:Code128>
        </componentElement>
4

1 回答 1

17

创建一个样式,我们称之为“条形码”,例如:

<style name="Barcode" fontName="Helvetica" fontSize="10" hAlign="Center" vAlign="Middle"/>

并将条形码元素的样式属性设置为“条形码”。

于 2014-04-22T12:17:36.140 回答