S
small pig
Unregistered / Unconfirmed
GUEST, unregistred user!
搞了将近一天,始终不知道出错在哪里?我的目的就是根据控件在窗体上的位置利用FASTREPORT来动态打印,谢谢各位大侠的参与回答.
var
m: TfrMemoView;
BandDetail: TfrBandView;
i: integer;
begin
frReport1.Pages.Clear;
frReport1.Pages.Add;
Page := frReport1.Pages[0];
//附加一页
BandDetail := TfrBandView(frCreateObject(gtBand, ''));
BandDetail.BandType := btMasterData;
BandDetail.Name := 'BandDetail';
Page.Objects.Add(BandDetail);
BandDetail.SetBounds(0, C_HEIGHT * 3, 0, 0);
m := TfrMemoView(frCreateObject(gtMemo, ''));
m.gapx := 0;
m.gapy := 0;
m.dx := 0;
for i := 0 to Form1.ComponentCount - 1do
begin
if (Components is TLabel) or (Form1.Components is TDBEdit) then
//把本窗体符合的控件打印出来
m.SetBounds(TControl(Components).Left, TControl(Components).Top,
TControl(Components).Width, TControl(Components).Height);
m.Name := TControl(Components).Name;
Page.Objects.Add(m);
end;
frReport1.ShowReport;
end;
var
m: TfrMemoView;
BandDetail: TfrBandView;
i: integer;
begin
frReport1.Pages.Clear;
frReport1.Pages.Add;
Page := frReport1.Pages[0];
//附加一页
BandDetail := TfrBandView(frCreateObject(gtBand, ''));
BandDetail.BandType := btMasterData;
BandDetail.Name := 'BandDetail';
Page.Objects.Add(BandDetail);
BandDetail.SetBounds(0, C_HEIGHT * 3, 0, 0);
m := TfrMemoView(frCreateObject(gtMemo, ''));
m.gapx := 0;
m.gapy := 0;
m.dx := 0;
for i := 0 to Form1.ComponentCount - 1do
begin
if (Components is TLabel) or (Form1.Components is TDBEdit) then
//把本窗体符合的控件打印出来
m.SetBounds(TControl(Components).Left, TControl(Components).Top,
TControl(Components).Width, TControl(Components).Height);
m.Name := TControl(Components).Name;
Page.Objects.Add(m);
end;
frReport1.ShowReport;
end;