Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Removing header and footer

edited May 2002 in General
I am thinking of using ReportBuilder as a label-design tool (using rtm-files
as a way of passing the information to a label-printer).

When i create a new template and start the designer, I need to find a way
to remove header and footer band from the report.

I have tried to use the code below to create a new report (label), but i am
not getting the desired result.

Any help would be appreciated.

Michael



procedure TfrmMain.NewReport;
begin
Report.Template.New;

Designer.Report.PrinterSetup.MarginBottom := 0;
Designer.Report.PrinterSetup.MarginLeft := 0;
Designer.Report.PrinterSetup.MarginRight := 0;
Designer.Report.PrinterSetup.MarginTop := 0;
Designer.Report.PrinterSetup.Units := utMillimeters;

Designer.Report.PrinterSetup.PaperHeight := 100; // standard settings for
a label
Designer.Report.PrinterSetup.PaperWidth := 100;

Designer.Report.HeaderBand.Visible := False;
Designer.Report.FooterBand.Visible := False;
Designer.Report.DefaultBands := [btDetail];
Designer.Show;
end;

Comments

  • edited May 2002
    Setting the visibility of the bands to False won't actually remove them from
    the designer. The simplest way to accomplish this is to replace the lines

    Designer.Report.HeaderBand.Visible := False;
    Designer.Report.FooterBand.Visible := False;

    with

    Designer.Report.HeaderBand.Free;
    Designer.Report.FooterBand.Free;

    --
    Cheers,

    Alexander Kramnik
    Digital Metaphors

This discussion has been closed.