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

header on subreport not printing

edited August 2004 in Subreports
Hi,

I'm creating everything at runtime, so no components are on the form.

I have a report with a variable number of subreports with header and footer.
The detailbands are printed ok, but the header and footer are not.

This is part of the source:

{Create Childreport}
MySubReport:=Tppsubreport.Create(self);
MySubReport.Band:=(FMyParentId].Report.Detailband);
MySubReport.CreateReport(FMyParentId].Report as tppReport);
MySubReport.PrintBehavior := PbChild;
MySubReport.Top := 5;

MyReport := tPPchildReport(MySubReport.Report);

MyReport.DefaultBands := [btheader,btdetail,btfooter];
MyReport.CreateDefaultBands;
MyReport.Units:=utMillimeters;
MyReport.Header.PrintHeight:=phStatic;
MyReport.Header.Height:=100;

aLabel:=tPPlabel.create(self);
With aLabel do
Begin
aLabel.band:=MyReport.header;
aLabel.Caption := 'some text';
aLabel.Font.Charset := ANSI_CHARSET;
aLabel.Font.Name := 'Gill Alt One MT';
aLabel.Font.Size := 12;
aLabel.Font.Color:= clBlack;
aLabel.Transparent := true;
aLabel.Left := 1;
aLabel.Top := 1;
aLabel.Width := 20;
aLabel.Alignment := taLeftJustify ;
End;

Ive tried setting PrintBehavior to pbSection.
The headers and footers ar printing fine now,
but every subreport is printed on a new page and I don't want that.

Any ideas?

Comments

  • edited August 2004
    Never mind.
    I discovered a nice newsgroup named tech-tips ;o)

    The answer is: header and footer do not work in pbchild-type reports
This discussion has been closed.