可以这样来写
var
rpt:TppReport;
bnd:TppHeaderBand;
lblhead:TppLabel;
lbldetail:TppLabel;
begin
rpt:=TppReport.Create(self);
bnd:=TppHeaderBand.Create(self);
bnd.Report:=rpt;
lblHead:=Tpplabel.Create(self);
lblDetail:=Tpplabel.Create(self);
lblHead.Text:='head';
lblDetail.Text:='detail';
lblHead.mmSetBounds(50000,70000,3000,400);
lblDetail.mmSetBounds(500,600,3000,400);
lblDetail.Band:=bnd;
lblHead.Band:=rpt.HeaderBand ;
rpt.Print;
end;
OK拉 detailband 和HeadDetail可以创建也可以不用创建,创建好的report对象包含他们