How To…Fill Space After the Last Column

Question

“Once my columns have finished printing on a page, how can I fill the remaining space to the bottom of the page?”

Solution

Use a group footer band to fill the space.  Inside the GroopFooterBand.BeforePrint event, check the remaining space on the page and resize the band to match that size.

Download: FillSpaceAfterLastColumn.zip

Sample Delphi code:

uses
  ppTypes, 
  ppUtils;


procedure TForm1.ppGroupFooterBand1BeforePrint(Sender: TObject);
begin
  ResizeGroupFooter;

end; 

procedure TForm1.ResizeGroupFooter;
var
  liMMHeight: Longint;
begin

  //Get the remaining space in mmthousandths (microns).
  liMMHeight := ppReport1.PrinterSetup.PageDef.mmHeight - ppDetailBand1.SpaceUsed - ppReport1.PrinterSetup.PageDef.mmMarginBottom;

  //Resize the group footer band.
  ppGroupFooterBand1.Height := ppFromMMThousandths(liMMHeight, utInches, pprtVertical, nil);

  //Resize objects inside the group footer.
  ppShape1.Height := ppFromMMThousandths(liMMHeight, utInches, pprtVertical, nil);

end;