gpt4 book ai didi

excel - iReport(JasperReports)额外行问题

转载 作者:行者123 更新时间:2023-12-02 09:17:37 25 4
gpt4 key购买 nike

当我从数据库导入数据并在 Excel 工作表中格式化报告时,数据之间出现了额外的空行。

编辑(评论中的澄清):Excel 中的输出显示记录之间有一个额外的空白行,字段之间有一个额外的空白列。

最佳答案

  • 添加net.sf.jasperreports.export.xls.remove.empty.space. Between.columnsnet.sf.jasperreports.export.xls.remove.empty.space. Between.rows 属性到报告模板。

net.sf.jasperreports.export.xls.remove.empty.space. Between.columns - 指定是否空的间隔柱是否应该删除。

net.sf.jasperreports.export.xls.remove.empty.space. Between.rows - 指定是否空的间隔行是否应该删除。

示例:

<jasperReport ...>
<property name="ireport.zoom" value="1.0"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<property name="net.sf.jasperreports.export.xls.remove.empty.space.between.columns" value="true"/>
<property name="net.sf.jasperreports.export.xls.remove.empty.space.between.rows" value="true"/>

有关配置属性的信息是here .

  • 您可以为textField元素设置isRemoveLineWhenBlankisBlankWhenNull来隐藏空白行。

如果当前 textField 为空,如何删除整行的示例:

<textField isBlankWhenNull="true">
<reportElement x="0" y="0" width="100" height="20" isRemoveLineWhenBlank="true"/>
<textElement/>
<textFieldExpression><![CDATA[$F{field}]]></textFieldExpression>
</textField>
  • 另一个假设是更改 Band 中所有 textField(或/和 staticText)元素的高度。

如果是这种设计:

design with a space between textField and the band's boundary

任意两行之间都会有一个空格。

如果是这种设计(textField 高度等于Band 高度): the textfield height is equal to the band's height

每行都将位于另一行的正下方。

关于excel - iReport(JasperReports)额外行问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8354126/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com