How To…PageBreak On a DataValue

Question

“How can I force a page break on specific data values?”

Solution

This example conditionally controls pagination by using a PageBreak component in the detail band andconditionally toggling the PageBreak.Visible property.

Download: PageBreakDataValueRAP.zip

Sample RAP code:

procedure DBText1OnPrint;
begin

  { force a page break }
  if orders['OrderNo'] = 1010 then
    PageBreak1.Visible := True
  else
    PageBreak1.Visible := False;

end;