iReport(JasperReports)额外的行问题 [英] iReport (JasperReports) extra row issue
问题描述
编辑
>(从注释的澄清):Excel中的输出显示记录之间的额外空白行和字段之间的额外的空白列。
ul>
net.sf.jasperreports.export.xls.remove.empty.space.between.columns
和 net.sf.jasperreports.export.xls.remove.empty.space.between.rows
属性报告模板。 net.sf.jasperreports.export .xls.remove.empty.space.between.columns
- 指定是否应删除空的间隔列。
示例: 有关配置属性的信息是 here 。 示例如果当前的 textField 是空的: net.sf.jasperreports.export.xls.remove.empty.space.between.rows
- 指定空的间隔行s / p>
< jasperReport ...>
< property name =ireport.zoomvalue =1.0/>
< property name =ireport.xvalue =0/>
< property name =ireport.yvalue =0/>
< property name =net.sf.jasperreports.export.xls.remove.empty.space.between.columnsvalue =true/>
< property name =net.sf.jasperreports.export.xls.remove.empty.space.between.rowsvalue =true/>
< textField isBlankWhenNull =true>
< reportElement x =0y =0width =100height =20isRemoveLineWhenBlank =true/>
< textElement />
< textFieldExpression><![CDATA [$ F {field}]]>< / textFieldExpression>
< / textField>
中的/ em>(或/和 staticText )元素
如果这种设计:
您将在任意两行之间留出空格。
设计( textField height等于乐队的高度):
每行将完全在另一条之下。
I am getting an extra empty row between data when I am importing it from the database and formatting the report in Excel sheet.
EDIT (clarification from a comment): The output in Excel shows an extra blank row between records and and extra blank column between fields.
- Add
net.sf.jasperreports.export.xls.remove.empty.space.between.columns
andnet.sf.jasperreports.export.xls.remove.empty.space.between.rows
properties to report template.
net.sf.jasperreports.export.xls.remove.empty.space.between.columns
- Specifies whether the empty spacer columns should be removed or not.
net.sf.jasperreports.export.xls.remove.empty.space.between.rows
- Specifies whether the empty spacer rows should be removed or not.
The sample:
<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"/>
The information about configuration properties is here.
- You can set isRemoveLineWhenBlank and isBlankWhenNull for textField element for hiding blank row.
The sample how to remove the whole line if the current textField is empty:
<textField isBlankWhenNull="true">
<reportElement x="0" y="0" width="100" height="20" isRemoveLineWhenBlank="true"/>
<textElement/>
<textFieldExpression><![CDATA[$F{field}]]></textFieldExpression>
</textField>
- Another assumption is to change the height of all textField (or/and staticText) elements in the Band.
In case this design:
you will have a space between any two rows.
In case this design (textField height is equal to the Band's height):
the each line will be exactly under the other.
这篇关于iReport(JasperReports)额外的行问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!