I use opentbs to generate lists in word documents. Is it possible to add a page break after x rows in a table?
I hope you can help me. If you need further information feel free to ask.
I use opentbs to generate lists in word documents. Is it possible to add a page break after x rows in a table?
I hope you can help me. If you need further information feel free to ask.
The solution is to use conditional sections in your block that is defined on the table row.
The first section has to be a row with a page break and a conditional display for each x rows (see under). The second section has to be a copy of first row but without the page break and which is set as the default section.
Here is an example with a page break on each 5 rows (x=5):
In the cell with the parameter when [...]=0
you have to go in the paragraph properties and set the option page break before
to checked.
Table :
|-----------------------------------------------------------|------|
| Column 1 | col2 |
|-----------------------------------------------------------|------|
| [b.nom;block=tbs:row;when [b.#;ope=nif:1,add:-1,mod:5]=0] | |
|-----------------------------------------------------------|------|
| [b.nom;block=tbs:row;default] | |
|-----------------------------------------------------------|------|
Explanation for the expression [b.#;ope=nif:1,add:-1,mod:5]=0
:
ope=...
will make serial computing on the value of the field.ope=mod:5
would make row #1 to be 1, row #5 to be 0...ope=add:-1,mod:5
would make row #1 to be 0, row #5 to be 4...ope=nif:1,add:-1,mod:5
will do the same except for row #1. So the page break does not occurs for the first row.So at the end, the expression is true for each 5 rows except for the first one.