Page 1 of 1

Velocity Reports widow/orphan control

PostPosted: Tue Aug 03, 2021 4:05 am
by roddy
Is it possible to have an autonomous block of text that cannot be split across a page break?

Re: Velocity Reports widow/orphan control

PostPosted: Tue Aug 03, 2021 5:45 am
by ROCLASI
Hi Roddy,

I am happy to say, yes you can :)
VelocityReport works with CSS and CSS has styles to control this behavior, one of them is page-break-inside.
So you could create a template like so where you define the style and use it.
Code: Select all
<html>
    <head>
        <style>
            .no-page-break { page-break-inside: avoid; }
        </style>
    </head>
    <body>
        #foreach($row in $myData)
        <div class="no-page-break">
            <!-- my block of data that should not split across a pagebreak -->
        </div>
        #end
    </body>
</html>


Hope this helps.

Re: Velocity Reports widow/orphan control

PostPosted: Tue Aug 03, 2021 8:44 am
by roddy
That is fab :-)

Many thanks.