【发布时间】:2011-11-03 21:46:54
【问题描述】:
我最近一直在玩 DynamicJasper,印象非常深刻。我唯一的问题是我创建的一些报告更像是打印的表格,在数据字段的左侧会有标签(技术上是列标题)。在 iReport 中绘制报告时,这不是问题。您只需将它们放在字段旁边的详细信息部分即可。
看起来:
jrxml 将是:
<detail>
<band height="125" splitType="Stretch">
<textField>
<reportElement x="56" y="0" width="76" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{Column 1}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="0" y="0" width="56" height="20"/>
<textElement/>
<text><![CDATA[Column 1:]]></text>
</staticText>
<textField>
<reportElement x="189" y="0" width="71" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{Column 2}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="132" y="0" width="57" height="20"/>
<textElement/>
<text><![CDATA[Column 2:]]></text>
</staticText>
<textField>
<reportElement x="318" y="0" width="73" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{Column 3}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="260" y="0" width="58" height="20"/>
<textElement/>
<text><![CDATA[Column 3: ]]></text>
</staticText>
<textField>
<reportElement x="451" y="0" width="100" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{Column 4}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="391" y="0" width="60" height="20"/>
<textElement/>
<text><![CDATA[Column 4]]></text>
</staticText>
</band>
</detail>
知道如何仅使用 Dynamic Jasper 实现这一目标吗?
【问题讨论】:
标签: java dynamic-jasper