Page Break based on a field value

0

Hello guys,

I am trying to find a way to change page based on a specific value that exist as a field on my table. For instance, I have a list of records where each record has an id and belongs to a Departement (integer values). On each Header page I print the Department code and below I have Column Header and Detail. How can I change page if the Department code changes? I have seen online that I have to use Group By  but I did not understand how to implement it. Can someone help me with an example please? Some people mentioned that you could use the Break Element,  but yet again I could not implement it.

Thank you.

fiyov46807's picture
Joined: Apr 28 2020 - 12:01am
Last seen: 6 days 1 hour ago

1 Answer:

0

I found the solution. I will answer my question so that if someone wants the answer, they can have it.

For instance, if you need to use page break when Department code changes you can do the following steps.

  1. Right click on your project and select Create Group
  2. In the pop-up window select a Group Name and from the Reports Objects below, select the field value you want. In this example we want the Department Code. Then select Next,  select only Add the Header Group and Finish.
  3. In the Outline window you will see that the new group appeared. 
  4. You will notice that the height of the new Group inside the Design Tab is big. Select the Group from the Outline window and in the Properties window check the following.
  5. In the Group Properties have the name of the group. Verify that the Expression is correct ($F{DepartmentCode}) . Select Reprint Header on Each Page (because on each page you have the Department Code). Select Start New Page and set the Height in the Band Properties to 1 px

 

fiyov46807's picture
Joined: Apr 28 2020 - 12:01am
Last seen: 6 days 1 hour ago
Feedback
randomness