我已经创建了一个基本上是员工填写的时间表的报表,所以它是一个表,其中一行设计为预先填写员工的数据(例如:姓名/ 姓…)。用静态字段填充页面的剩余空间
我的SQL请求检索16个员工记录。一页只包含13行,所以它会自动为最后3行创建第二页。我的问题(和要求)是创建包含13行的第二页,其中3个将填充记录,其中10个将留空。
下面是一个例子:
我怎样才能做到这一点?
如果我想创建一个带有13个空行的额外页面,该怎么办?
有人可以帮我吗?
我已经创建了一个基本上是员工填写的时间表的报表,所以它是一个表,其中一行设计为预先填写员工的数据(例如:姓名/ 姓…)。用静态字段填充页面的剩余空间
我的SQL请求检索16个员工记录。一页只包含13行,所以它会自动为最后3行创建第二页。我的问题(和要求)是创建包含13行的第二页,其中3个将填充记录,其中10个将留空。
下面是一个例子:
我怎样才能做到这一点?
如果我想创建一个带有13个空行的额外页面,该怎么办?
有人可以帮我吗?
我得到了我的JasperSoft这个communauty论坛回答:http://community.jaspersoft.com/questions/817708/resolved-how-fill-reports-blank-space-empty-row-table
的原理是自定义背景的乐队,这里是在模型的例子:
<background>
<band height="555" splitType="Stretch">
<rectangle>
<reportElement uuid="ee3fa6a5-eddb-4b38-b834-f2658bcf92d1" x="0" y="59" width="800" height="427"/>
</rectangle>
<line>
<reportElement uuid="4494e946-4ff5-4d57-b3eb-9d64eda302c4" x="0" y="95" width="800" height="1"/>
</line>
<line>
<reportElement uuid="4494e946-4ff5-4d57-b3eb-9d64eda302c4" x="0" y="125" width="800" height="1"/>
</line>
<line>
<reportElement uuid="4494e946-4ff5-4d57-b3eb-9d64eda302c4" x="0" y="155" width="800" height="1"/>
</line>
<line>
<reportElement uuid="4494e946-4ff5-4d57-b3eb-9d64eda302c4" x="0" y="185" width="800" height="1"/>
</line>
<line>
<reportElement uuid="4494e946-4ff5-4d57-b3eb-9d64eda302c4" x="0" y="215" width="800" height="1"/>
</line>
<line>
<reportElement uuid="4494e946-4ff5-4d57-b3eb-9d64eda302c4" x="0" y="245" width="800" height="1"/>
</line>
<line>
<reportElement uuid="4494e946-4ff5-4d57-b3eb-9d64eda302c4" x="0" y="275" width="800" height="1"/>
</line>
<line>
<reportElement uuid="4494e946-4ff5-4d57-b3eb-9d64eda302c4" x="0" y="305" width="800" height="1"/>
</line>
<line>
<reportElement uuid="4494e946-4ff5-4d57-b3eb-9d64eda302c4" x="0" y="335" width="800" height="1"/>
</line>
<line>
<reportElement uuid="4494e946-4ff5-4d57-b3eb-9d64eda302c4" x="0" y="365" width="800" height="1"/>
</line>
<line>
<reportElement uuid="4494e946-4ff5-4d57-b3eb-9d64eda302c4" x="0" y="395" width="800" height="1"/>
</line>
<line>
<reportElement uuid="4494e946-4ff5-4d57-b3eb-9d64eda302c4" x="0" y="425" width="800" height="1"/>
</line>
<line>
<reportElement uuid="4494e946-4ff5-4d57-b3eb-9d64eda302c4" x="0" y="455" width="800" height="1"/>
</line>
<line>
<reportElement uuid="01f3d5fc-9d23-4c7b-96cf-0ff7b3285400" x="160" y="59" width="1" height="427"/>
</line>
<line>
<reportElement uuid="01f3d5fc-9d23-4c7b-96cf-0ff7b3285400" x="320" y="59" width="1" height="427"/>
</line>
<line>
<reportElement uuid="01f3d5fc-9d23-4c7b-96cf-0ff7b3285400" x="480" y="59" width="1" height="427"/>
</line>
<line>
<reportElement uuid="01f3d5fc-9d23-4c7b-96cf-0ff7b3285400" x="639" y="59" width="1" height="427"/>
</line>
</band>
</background>
这取决于什么数据源你正在使用......如果您使用Javaabeans作为数据源,那么它可以轻松完成。只需添加10个bean(空值)和wholla ...你将在第二页获得3(前一页记录)+10(空白记录)...... 此外,我坚持你完成13个记录到单个页面通过减少表格或列表中的单元格大小,无论您在报告中有什么内容。
在背景带上绘制网格,并在所有其他带中将属性不透明更改为true。
我得到同样的问题,这帮助了我。 单击设计器选项卡上的jrxml文件中的表,转到属性并在表达式字段中输入'$ V {REPORT_COUNT} == 1'时打印。 确保您选中了'删除行时空白'。
是否要添加固定数量的行或动态(取决于页面上的“空闲”空间)? –
事实上,如果一行的高度发生变化,它会动态地执行以避免花费太多时间。 –