首页 文章

Jasper iReport静态文本和文本字段之间的奇怪空间

提问于
浏览
0

我有一个带静态文本的Jasper / iReport和一个直接在它后面的文本字段:

如您所见,两个字段之间几乎没有额外的空间 . 但是当我渲染它时,它会显示如下:

知道为什么吗?

Jrxml样品

<?xml version="1.0" encoding="UTF-8"?>
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="report1" language="groovy" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="fcf485a8-4a9b-49b5-ba23-15b22808d171">
    <property name="ireport.zoom" value="3.0"/>
    <property name="ireport.x" value="682"/>
    <property name="ireport.y" value="0"/>
    <field name="testfield" class="java.lang.String"/>
    <background>
        <band splitType="Stretch"/>
    </background>
    <summary>
        <band height="107" splitType="Stretch">
            <staticText>
                <reportElement x="0" y="49" width="224" height="15" uuid="d706eb33-a1da-4ec2-b774-f27d6ea50b72"/>
                <textElement verticalAlignment="Middle" markup="none">
                    <font fontName="Arial" size="8" isBold="true"/>
                </textElement>
                <text><![CDATA[Please Note: In order to qualify for the Earlybird Discounts]]></text>
            </staticText>
            <textField>
                <reportElement x="224" y="49" width="59" height="15" uuid="a559bcca-c8b7-4a12-a45a-ee7a6677cccf"/>
                <textElement verticalAlignment="Middle">
                    <font fontName="Arial" size="8"/>
                </textElement>
                <textFieldExpression><![CDATA[($F{testfield} != null) ? $F{testfield} : "This is text field"]]></textFieldExpression>
            </textField>
        </band>
    </summary>
</jasperReport>

我注意到当我在iReport中预览它显示正常时,但是当你在Adobe Reader中打开时,它有额外的空间 .

1 回答

  • 0

    您可以将两个文本放在文本字段中,如:“收到前或收到”$ P

    如果那不可行,请在外观中设置“拉伸类型:无拉伸” .

相关问题