【发布时间】:2016-03-21 19:35:19
【问题描述】:
我想为一个多行显示其内容的文本字段绘制一个虚线底部边框。
例如:
Address: 104th Street,
- - - - - - - - - - -- - - - - - - -- - - - - -
Beside Market Area
- - - - - -- - - - - -- - - - - -- - - - -- - -
Illinois,617273
- - - - - -- - - - - -- - - - - -- - - - -- - -
目前,当我将边框底部设置为文本字段时,它以这种方式显示
Address: 104th Street,
Beside Market Area
Illinois,617273
- - - - - -- - - - - -- - - - - -- - - - -- - -
请帮助我了解如何为多行文本的每行设置边框底部
在下面找到我的 jxml 代码
<?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="Blank_A4_1" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="ab424386-3966-4b59-9892-31b3fdb6c498">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="Mysql Adapter "/>
<property name="com.jaspersoft.studio.data.sql.tables" value=""/>
<queryString>
<![CDATA[Select "104th Street,\n Beside Market Area\n Illinois,617273" as address from dual]]>
</queryString>
<field name="address" class="java.lang.String"/>
<title>
<band height="79" splitType="Stretch"/>
</title>
<detail>
<band height="125" splitType="Stretch">
<staticText>
<reportElement x="10" y="30" width="122" height="30" uuid="b2d1bb4b-38b0-47e9-8da8-5ce6a31c98a8"/>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font size="20"/>
</textElement>
<text><![CDATA[Address]]></text>
</staticText>
<textField isStretchWithOverflow="true">
<reportElement x="150" y="30" width="390" height="30" uuid="40d76fd8-76d0-4d37-8bc7-bb4e48749df2"/>
<box leftPadding="10">
<bottomPen lineWidth="1.0" lineStyle="Dashed"/>
</box>
<textElement verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$F{address}]]></textFieldExpression>
</textField>
</band>
</detail>
<pageFooter>
<band height="54" splitType="Stretch"/>
</pageFooter>
</jasperReport>
【问题讨论】:
-
请附上一些相关的 jrxml 代码,以便我们看到你现在在做什么...stretchWithOverFlow??
-
使用 JRXML 代码更新
标签: jasper-reports