Question: "How can I force a page break occur based upon a condition calculated at run-time."
Two of the best solutions follow:
Solution 1:
Define a Group that starts on a new page when it breaks. Then use the Group.OnGetBreakValue
event to control the timing of the break.
procedure Form1.Group1OnGetBreakValue(Sender: TObject; var aBreakValue: String);
begin
if condition then
aBreakValue := 'Some Value';
end; Solution 2:
By programmatically setting the title band's NewPage property you can conditionally force a page break. Note that everything after the subreport that is in the same band with it will need to ShiftRelativeTo the subreport.