DynamicJasper 可以将列标题放在详细信息部分吗?
我最近一直在玩 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 来实现这一点吗?
I have been playing with DynamicJasper lately, and have been pretty impressed. The only issue I have is that some of the reports I create are more like printed forms, where you would have the label (which is technically the column header) to the left of the data field. When drawing the report in iReport this is not an issue. You would just place them in the detail section next to the field.
It would look:
The jrxml would be:
<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>
Any idea how to pull this off with just Dynamic Jasper?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
目前这在 DynamicJasper 中不可行。需要一个新的 LayoutManager 实现。
Dj 旨在仅解决基于列的报告。
this is not doable currently in DynamicJasper. A new
LayoutManager
implementation would be needed.Dj aims to resovle column based reports only.