Add a conditional page break inside report

37 views
Skip to first unread message

Maxime Richez

unread,
Mar 2, 2018, 4:47:19 AM3/2/18
to tryton-dev
Hello,

Does anyone knows a define a conditional page break inside a report ?
We need to print a page as a "big label" and if i select multiple records, each record should fill exactly one page. And if i print only one record, i don't want an empty blank page after the printed page.
Same problem with the purchases:
If i try to print multiple purchases, there is no page break and all the selected purchases are printed following each other
Thanks for help !

Sergi Almacellas Abellana

unread,
Mar 2, 2018, 4:53:18 AM3/2/18
to tryto...@googlegroups.com
El 02/03/18 a les 10:47, Maxime Richez ha escrit:
We have some custom modules that need the same behaviour and we
implemented it by surrounding the page break with the following if
condition:

if test="records and record != records[-1]"
/if

This will add a page break for all pages except the last one.

Hope it helps.


--
Sergi Almacellas Abellana
www.koolpi.com
Twitter: @pokoli_srk

Maxime Richez

unread,
Mar 2, 2018, 10:01:12 AM3/2/18
to tryton-dev

> We have some custom modules that need the same behaviour and we
> implemented it by surrounding the page break with the following if
> condition:
>
> if test="records and record != records[-1]"
> /if
>
> This will add a page break for all pages except the last one.
>
> Hope it helps.

Working. Thanks ! :-)

Reply all
Reply to author
Forward
0 new messages