JasperReports: counting pages depending on group

2019-06-07 05:41发布

The problem is like this.

The report page numbers that are displayed on the page should not be dependent on the current but on the group page.

Let me explain:

I have a report with 2 groups that has 4 pages, each group on two pages, and what I need to do is the following:

group 1 page 1: should be: 1/2 -> current: 1/4
group 1 page 2: should be: 2/2 -> current: 2/4
group 1 page 1: should be: 1/2 -> current: 3/4
group 1 page 2: should be: 2/2 -> current: 4/4

Is there any way this can be done ...

PS. No black magic allowed, I had a look at the variables that are defined in JasperReports but none of them fit the profile :)

2条回答
倾城 Initia
2楼-- · 2019-06-07 06:22

You could try setting setting the isResetPageNumber attribute of the group to true.

e.g. <group name="someGroupName" isResetPageNumber="true" >

查看更多
Viruses.
3楼-- · 2019-06-07 06:32

user51931 answer is correct ! It also helpful to me.

You can also set this group property from design view.

enter image description here

查看更多
登录 后发表回答