Header keep at least 1 row

edited 10:30PM in FastReport VCL
How do I make a header keep at least 1 row? I want it to not show the header if the first line will be on the next page. Otherwise I end up with the possibility of a header on the bottom of the page with no rows. I do not want to use Keep Together because that will put the whole group onto the next page.

Comments

  • LurkingKiwiLurkingKiwi Wellington, New Zealand
    edited 10:30PM
    I use the following code, obtained from FR support or somebody in the forum:

    procedure GroupHeader2OnBeforePrint(Sender: TfrxComponent);
    begin
    if (<force_break> <> 0) or (engine.freespace < (GroupHeader2.Height + MasterData1.Height * 2 + 1)) then
    engine.newpage;
    end;

    where
    force_break is a column in the dataset used to insert manual pagebreaks
    GroupHeader2 has the column headings and the BeforePrint handler
    MasterData1 has the fields

    MasterData1.Height is multiplied by 2 to prevent widows (a single data line at the bottom of the page under the header); the 1 is added to allow for mathematical effects.

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.