How to provide a page break inside template grid data?

0
Dear All, I am trying to generate a pdf/word report which will print data of multiple applications one by one. To print multiple applications I am using template grid widget inside my document template. I want to print each application in a new page of the document. When I use the page break widget inside template it's saying you can't use a page-break widget inside it. I tried using 'page-break-after: always;' css property also inside main table of template grid, still it didn't workout. Can you please help me with this how can I achieve this?
asked
3 answers
16

Hey guys,

This for sure is possible.

You can force a page break on your table by using CSS. You can do this by putting a single cell table in your template grid and adding the style "page-break-after: always;" to that cell. Continue building your document template inside that cell. It will always break the page after that cell has been made.

Hope that helps.

answered
1

Template grids are rendered as a table, but document formats don't tend to support real page breaks within a table. So basically this is not really possible. What you could do is render multiple documents and merge them using a library like PDF merge, I think there are some examples on this forum for that.

answered
1

Many thanks Dirk and Sander for pointing me in the right direction. 

I kept getting an error: "Invalid property encountered on "fo:table-cell": age-break-after (See position 2:2488)". 

The trick is to add the "page-break-after: always;" styling to the table within the Template Grid (Mendix 8.18.1).

Right click on the cell > Select Table and add the styling there. 

 

 

answered