G
guoming790128
Unregistered / Unconfirmed
GUEST, unregistred user!
我想动态创建一个子报表,如下程序,显示的却是第二页的内容,我想在一张纸上显示两页的内容,不知如何做?procedure TForm1.Button11Click(Sender: TObject);var v: TfrView;
b: TfrBandView;
subreport : tfrSubReportView;
Page: TfrPage;
begin
frReport2.Pages.Clear;
frReport2.Pages.Add;
// create page Page := frReport2.Pages[0];
Page.Name := 'page1';
b := TfrBandView.Create;
// create Title band b.SetBounds(0, 40, 758, 24);
// position and size in pixels b.BandType := btMasterHeader;
b.Prop['Stretched'] := True;
Page.Objects.Add(b);
// for the band) v := TfrMemoView.Create;
// create memo v.SetBounds(16, 40, 758, 24);
v.Prop['Stretched'] := True;
v.Memo.Add('memo1');
Page.Objects.Add(v);
b := TfrBandView.Create;
// create Title band b.SetBounds(0, 128, 758, 24);
// position and size in pixels b.BandType := btMasterData;
Page.Objects.Add(b);
// for the band) subreport := tfrSubReportView.Create;
// create memo subreport.SetBounds(0, 128, 758, 24);
Page.Objects.Add(subreport);
frReport2.Pages.Add;
// create page Page := frReport2.Pages[1];
Page.Name := 'page2';
Page.PrintToPrevPage := true;
b := TfrBandView.Create;
// create Title band b.SetBounds(0, 40, 758, 24);
// position and size in pixels b.BandType := btMasterHeader;
b.Prop['Stretched'] := True;
Page.Objects.Add(b);
// for the band) v := TfrMemoView.Create;
// create memo v.SetBounds(16, 40, 758, 24);
v.Prop['Stretched'] := True;
v.Memo.Add('Memo2');
Page.Objects.Add(v);
frReport2.ShowReport;
end;
b: TfrBandView;
subreport : tfrSubReportView;
Page: TfrPage;
begin
frReport2.Pages.Clear;
frReport2.Pages.Add;
// create page Page := frReport2.Pages[0];
Page.Name := 'page1';
b := TfrBandView.Create;
// create Title band b.SetBounds(0, 40, 758, 24);
// position and size in pixels b.BandType := btMasterHeader;
b.Prop['Stretched'] := True;
Page.Objects.Add(b);
// for the band) v := TfrMemoView.Create;
// create memo v.SetBounds(16, 40, 758, 24);
v.Prop['Stretched'] := True;
v.Memo.Add('memo1');
Page.Objects.Add(v);
b := TfrBandView.Create;
// create Title band b.SetBounds(0, 128, 758, 24);
// position and size in pixels b.BandType := btMasterData;
Page.Objects.Add(b);
// for the band) subreport := tfrSubReportView.Create;
// create memo subreport.SetBounds(0, 128, 758, 24);
Page.Objects.Add(subreport);
frReport2.Pages.Add;
// create page Page := frReport2.Pages[1];
Page.Name := 'page2';
Page.PrintToPrevPage := true;
b := TfrBandView.Create;
// create Title band b.SetBounds(0, 40, 758, 24);
// position and size in pixels b.BandType := btMasterHeader;
b.Prop['Stretched'] := True;
Page.Objects.Add(b);
// for the band) v := TfrMemoView.Create;
// create memo v.SetBounds(16, 40, 758, 24);
v.Prop['Stretched'] := True;
v.Memo.Add('Memo2');
Page.Objects.Add(v);
frReport2.ShowReport;
end;