Designer tips and tricks: Keep the rows from breaking across pages

When designing a report we usually want to prevent related content from breaking between pages. Microsoft Word offers the standard pagination functionalities Window/Orphan control, Keep with next, and Keep lines together which work as intended with static content. However, when displaying content dynamically, as is the case with Docentric templates, these three functionalities can display unpredicted behavior.

There are two typical use cases where the standard functionalities might not be enough:

  1. The dynamic content that replaces the tagging element within one single table row extends to multiple rows.

  1. We place the related content in multiple table rows, and want to prevent them from breaking across pages.

To prevent that, we can insert a delimiter row in the table. Below are the steps Docentric recommends when dealing with rows breaking across pages (in the listed sequence).

Basic steps

  1. Select the table rows you’d like to keep together and open Paragraph options.
  2. Under the Line and Page Breaks tab, select the following three Pagination options: Widow/Orphan control, Keep with next, and Keep lines together, then select OK to confirm.

Turn on the Paragraph marks and check whether a small square is present at the beginning of the row - the square indicates the Keep with Next and/or Keep lines together options were applied.

Advanced steps

If the basic steps do not resolve the issue, continue by adding a delimiter row. It is crucial the delimiter row is inside the List tagging element and that it does not have any conditions applied (for example an If tagging element).

  1. Insert a new row below the first row in the List tagging element. The reason for that is that if we added a row above the first row, we would also insert a new List tagging element.

  2. Select the entire first row with the tagging elements, right-click, and select Cut.

  1. Paste the row by selecting the row behind the empty one, and pressing CTRL+P. The empty row should now be the first inside the List tagging element.

  1. Select the empty row and open the Paragraph settings.

  2. Under the Line and Page Breaks tab, unselect Keep with next, and Keep lines together, then select OK to confirm.

If you take a look at the PDF preview you might notice a big gap between individual records repeated by the List tagging element. No worries, we’ll take care of that as well. But first, let’s test if the template is working as expected.

Testing the template behavior

  1. Go to the Docentric AX tab, and select Word Preview.

  1. Position your mouse just above the last group of content you’d like to keep together at the end of the page and enter a few new spaces by pressing Enter on your keyboard. The related records should move together as one element.

Removing the gap between records in the List tagging element

  1. Select the entire empty row and in the Home tab, change the font size to 1.
  2. While the row is selected, open the Paragraphs settings again, and set the before/after spacing to zero and the Line spacing to Single. Confirm the setup by selecting OK.

  1. Go to the Layout tab and select Table properties.
  2. Under the Row tab, make sure the Specify height is unchecked to prevent any fixed cell height from influencing the height of the row.