好好看一下,建立BAND等!!!
frReport1.Pages.Add;
// create page
Page := frReport1.Pages[Pagered^.ipage];
b := TfrBandView.Create;
// create Title band
b.SetBounds(0,ttop, 0, theight);
// position and size in pixels
b.BandType := btPageHeader;
// (only Top and Height are significant
Page.Objects.Add(b);
// for the band)
icount :=MyList.Count;
for i:=0 to icount-1do
begin
mLabstr := MyList.Items;
CreatLab(mLabstr,0);
end;
icount :=MyListcap.Count;
for i:=0 to icount-1do
begin
mLabstr := MyListcap.Items;
CreatLab(mLabstr,1);
end;
b := TfrBandView.Create;
// create MasterData band
b.SetBounds(0, dtop, 0, idataHight);
b.BandType := btMasterData;
b.Dataset := Pagered^.frdb.Name;
// band's dataset
Page.Objects.Add(b);
for i:=0 to icount-1do
begin
mLabstr := MyListdata.Items;
CreatLab(mLabstr,1);
end;
b := TfrBandView.Create;
b.SetBounds(0, gtop, 0, idataHight);
b.BandType := btMasterFooter ;
b.Script.Add('begin
');
stemp:='while FreeSpace * 5/18 > ' + inttostr(idataHight) + 'do
';
b.Script.Add(stemp);
b.Script.Add(' ShowBand(Child1) ');
b.Script.Add('end');
b.Name :='MasterFooter';
Page.Objects.Add(b);
b := TfrBandView.Create;
b.SetBounds(0, ctop, 0, idataHight);
b.BandType := btChild ;
b.Name :='Child1';
Page.Objects.Add(b);
for i:=0 to icount-1do
begin
mLabstr := mynull.Items;
CreatLab(mLabstr,1);
end;
b := TfrBandView.Create;
// create Title band
b.SetBounds(0, ftop, 0, fheight);
// position and size in pixels
b.BandType := btPagefooter;
// (only Top and Height are significant
Page.Objects.Add(b);
// for the band)
icount :=Myfoot.Count;
for i:=0 to icount-1do
begin
mLabstr := Myfoot.Items;
CreatLab(mLabstr,0);
end;