如何使用像数据一样的表创建报表?
我能够创建一个包含以下详细信息的报告.它以类似表格的结构排列数据.
<jasperReport>
.
.
<pageHeader>
<band height="30">
<staticText>
<reportElement x="0" y="0" width="69" height="24" />
<textElement verticalAlignment="Bottom" />
<text><![CDATA[ID: ]]></text>
</staticText>
<staticText>
<reportElement x="140" y="0" width="69" height="24" />
<textElement verticalAlignment="Bottom" />
<text><![CDATA[NAME: ]]></text>
</staticText>
<staticText>
<reportElement x="280" y="0" width="69" height="24" />
<textElement verticalAlignment="Bottom" />
<text><![CDATA[AGE: ]]></text>
</staticText>
</band>
</pageHeader>
<detail>
<band height="30">
<textField>
<reportElement x="0" y="0" width="69" height="24" />
<textFieldExpression class="java.lang.String"><![CDATA[$F{id}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="140" y="0" width="69" height="24" />
<textFieldExpression class="java.lang.String"><![CDATA[$F{name}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="280" y="0" width="69" height="24" />
<textFieldExpression class="java.lang.String"><![CDATA[$F{age}]]></textFieldExpression>
</textField>
</band>
</detail>
</jasperReport>
Run Code Online (Sandbox Code Playgroud)
但行和列没有边框?我如何在Jasperreport 4.5中实现这一目标?
谢谢
Ale*_*x K 17
<textField>
<reportElement x="29" y="17" width="100" height="20"/>
<box>
<topPen lineWidth="1.0"/>
<leftPen lineWidth="1.0"/>
<bottomPen lineWidth="1.0"/>
<rightPen lineWidth="1.0"/>
</box>
<textElement/>
<textFieldExpression><![CDATA[$F{field}]]></textFieldExpression>
</textField>
Run Code Online (Sandbox Code Playgroud)
在iReport中,您可以使用"填充和边框"上下文菜单.

在Jaspersoft Studio中,您可以在" 属性"对话框(选项卡边框)的帮助下设置边框.
| 归档时间: |
|
| 查看次数: |
25781 次 |
| 最近记录: |