Velocity Reports widow/orphan control

Questions and answers on designing your Servoy solutions, database modelling and other 'how do I do this' that don't fit in any of the other categories

Velocity Reports widow/orphan control

Postby roddy » Tue Aug 03, 2021 4:05 am

Is it possible to have an autonomous block of text that cannot be split across a page break?
roddy
 
Posts: 65
Joined: Mon Oct 26, 2020 12:32 am

Re: Velocity Reports widow/orphan control

Postby ROCLASI » Tue Aug 03, 2021 5:45 am

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.
Robert Ivens
SAN Developer / Servoy Valued Professional / Servoy Certified Developer

ROCLASI Software Solutions / JBS Group, Partner
Twitter: @roclasi
--
ServoyForge - Building Open Source Software.
PostgreSQL - The world's most advanced open source database.
User avatar
ROCLASI
Servoy Expert
 
Posts: 5385
Joined: Thu Oct 02, 2003 9:49 am
Location: Netherlands/Belgium

Re: Velocity Reports widow/orphan control

Postby roddy » Tue Aug 03, 2021 8:44 am

That is fab :-)

Many thanks.
roddy
 
Posts: 65
Joined: Mon Oct 26, 2020 12:32 am


Return to Programming with Servoy

Who is online

Users browsing this forum: No registered users and 8 guests