Page Break in Document Template depending on location current record

I made a Document Template with an overview of all active orders. Each order have one or more order rows. On a page there is space for 4 or 5 orders, depends on the amount of order rows. Now I like a page break before order 5 if it not fits on the current page anymore.
1 answers

You could try counting the records first and setting a boolean. Then you can use this boolean in the document template to show which part to print with either with or without the page break. Not the most elegant sollution but I think this will work.