iReport(JasperReports)额外行问题
当我从数据库导入数据并在 Excel 工作表中格式化报告时,数据之间出现了额外的空行。
编辑(评论中的澄清):Excel 中的输出显示记录之间有一个额外的空白行,字段之间有一个额外的空白列。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
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
- 指定是否为空间隔列是否应该删除。net.sf.jasperreports.export.xls.remove.empty.space. Between.rows
- 指定空间隔行是否是否应该删除。示例:
配置属性的信息为此处 。
如果当前 textField 为空,示例如何删除整行:
如果是这样的设计:
任意两行之间都会有一个空格。
如果是这种设计(textField 高度等于Band's 高度):

每行将恰好位于另一行下方。
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:
The information about configuration properties is here.
The sample how to remove the whole line if the current textField is empty:
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.
Alex K 在 2011 年 12 月 2 日的回答中所说的一切都是正确的。但其他一些设置可能会有所帮助。当报表文本拉伸详细信息区域时,这些设置会有所帮助。
在详细信息区域集中的每个字段上:
positionType=“Float”
stretchType=“RelativeToTallestObject”
示例:
这将强制所有字段均为一个高度。浮动设置告诉字段最小化上一行和下一行之间的距离。 relativeToTallestObject 设置告诉带区中的所有字段与最高字段的高度相同。这两个设置有助于消除在 Excel 中显示为不需要的单元格的“空白区域”。
Every thing that Alex K states in his Dec 2 '11 answer is correct. But a few other settings may be helpful. These settings help when the text of the report stretches the detail band.
On every field in the detail band set:
positionType="Float"
stretchType="RelativeToTallestObject"
Example:
This will force the all fields to be one height. The float setting tells the field to minimize the distance between the previous and next row. The RelativeToTallestObject setting tells all fields in the band to be the same height as the tallest field. These two settings help eliminate 'empty space' which shows up as unwanted cells in Excel.