Printing lines to fill empty space on the bottom of the page between masterdata and pagefooter bands


My masterdata band has stretched property set to True. In masterdata band every field has vertical frame lines.

If amount of records is several pages or longer, I want at the end of each page if another record can not fit on the same page that free space between masterdata band and pagefooter band to have lines stretching to the pagefooter.

In order to do that I have child band "ChildFrameLines" which purpose is to draw lines and fill the empty space between masterdata and pagefooter.
procedure MasterData1OnAfterPrint(Sender: TfrxComponent);
begin
  if Engine.Freespace < MasterData1.Height then
    Engine.Showband(ChildFrameLines);
end;

procedure ChildFrameLinesOnAfterCalcHeight(Sender: TfrxComponent);
begin
  ChildFrameLines.Height := Engine.Freespace;
end;

This code does the job except in one case.

Let's say the last record on the page (10th data record) didn't have need to strech and the first record on next page (11th data record) requires the master data band to stretch itself to show all the data.

What happens is that after the report prints the last record on the page it goes to MasterData1OnAfterPrint event and checks whether to showband ChildFrameLines.

It says that masterdata1.height (of the 10th record) is bigger then Engine.Freespace and it does not show ChildFrameLines. Since the 11th record is strecthing masterdata band it goes to the next page and ChildFrameLines was not called when it should of been.

Any help appreciated.

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 4:10PM
    Try running your code in the obp event of the footer

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.