Jasper reports 用静态字段填充页面的剩余空间

Jasper reports 用静态字段填充页面的剩余空间,jasper-reports,Jasper Reports,我创建了一个报告,它基本上是一个供员工填写的时间表,因此它是一个表,其中一行被设计为预先填充员工的数据(例如:姓名…) 我的SQL请求检索16名员工的记录。一个页面仅包含13行,因此它将自动为最后3行创建第二个页面。我的问题(和要求)是创建第二个包含13行的页面,其中3行将填充记录,10行将留空 以下是一个例子: 我该怎么做 如果我想创建一个包含13个空行的额外页面,该怎么办 有人能帮我吗?我在jaspersoft社区论坛上得到了答案: 其原理是自定义背景的波段,模型示例如下: <bac

我创建了一个报告,它基本上是一个供员工填写的时间表,因此它是一个表,其中一行被设计为预先填充员工的数据(例如:姓名…)

我的SQL请求检索16名员工的记录。一个页面仅包含13行,因此它将自动为最后3行创建第二个页面。我的问题(和要求)是创建第二个包含13行的页面,其中3行将填充记录,10行将留空

以下是一个例子:

我该怎么做

如果我想创建一个包含13个空行的额外页面,该怎么办


有人能帮我吗?

我在jaspersoft社区论坛上得到了答案:

其原理是自定义背景的波段,模型示例如下:

<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(带有空值)和whilla…您将在第二页中得到3个(上一页记录)+10个(空白记录)。。。。
此外,我坚持要求您通过减小表格或列表中单元格的大小,将13条记录填写到一页中。

在背景栏上绘制一个网格,并将所有其他栏中的不透明属性更改为true。

我遇到了同样的问题,这对我有所帮助。 单击designer选项卡上jrxml文件中的表,转到properties并在print when expression字段中写入“$V{REPORT_COUNT}==1”。
确保选中“空白时删除行”。

是否要添加固定行数或动态行数(取决于页面上的“可用”空间)?实际上,最好是动态添加,以避免在一行高度发生变化时花费太多时间。创建了一个拉取请求,将属性添加到JasperReports以填充空行。。。