搞定了,请客 (200分)

  • 主题发起人 small pig
  • 开始时间
S

small pig

Unregistered / Unconfirmed
GUEST, unregistred user!
窗体上有几个edit控件(不定),怎样用fastreport动态来把他们里面的数据打印出来?
 
用遍历一下
for i := 0 to Form1.ComponentCount - 1
begin
tmpEdit := Form1.Components as TEdit ;
...
end;
 
楼上两位没有答在点子,但是还是谢谢各位
 
duancy@163.net
 
好好看一下,建立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;
 
在报表中的一个memo中标上sa即可,其他的同理
procedure TForm1.frReport1GetValue(const ParName: String;
var ParValue: Variant);
begin
if parname='sa' then
parvalue:=edit1.text;
end;
 
procedure Tfrmdepotdetail.N3Click(Sender: TObject);//打印按钮
var
t:TfrMemoView;
begin
frDBDataSet1.DataSet:=Query_depotdetail;
frReport1.LoadFromFile('biao/其他/仓库明细帐.frf');
t:= TfrMemoView(uDataModule.DataModule1.frReport1.FindObject('memo16'));
t.Memo.Text:=carid.Text;
t:= TfrMemoView(uDataModule.DataModule1.frReport1.FindObject('memo26'));
t.Memo.Text:='入库数量: '+inttostr(i_ALLNO);
.........................
end;
希望对你有帮助!!
 
frRInstock.LoadFromFile('../报表单元/InStock.frf');
frRInstock.FindObject('memo1').Memo.Text:=edit1.text;
frRInstock.FindObject('memo2').Memo.Text:=edit2.text;
.....
 
拿分来了.
 
學習中.........................................
 
随便给点吧
 
接分!谢谢
 
接分,哇哈哈
 
用fr的变量啊,对应赋值就可以了
 

Similar threads

回复
0
查看
733
不得闲
回复
0
查看
847
不得闲
D
回复
0
查看
763
DelphiTeacher的专栏
D
顶部