设置赋值的TfrMemoView的内容为: [mytext]with myFrReport.Dictionary do begin Variables['mytext'] := '''' + form1.edit1.text + ''''; end; myFrReport.showreport;给分吧
//========不用变量,我都是这样作。 procedure TFrmRecord.frReport1BeforePrint(Memo: TStringList; View: TfrView); begin if View.Name = 'Picture1' then TfrPictureView(View).Picture.Assign(Image1.Picture); if View.Name = 'Memo17' then TfrPictureView(view).FormatStr:='asdfasdf'; end;
简单的: var t: TfrMemoView; begin t := TfrMemoView(frReport1.FindObject('Memo1')); if t <> nil then t.Memo.Text := 'FastReport'; end;
将你要赋值的memo的内容设为这个变量
然后,在TFrReport的onGetValue事件中,给这个变量赋值就行了,注意,大小写是敏感的
begin
Variables['mytext'] := '''' + form1.edit1.text + '''';
end;
myFrReport.showreport;给分吧
procedure TFrmRecord.frReport1BeforePrint(Memo: TStringList;
View: TfrView);
begin
if View.Name = 'Picture1' then
TfrPictureView(View).Picture.Assign(Image1.Picture);
if View.Name = 'Memo17' then
TfrPictureView(view).FormatStr:='asdfasdf';
end;
t: TfrMemoView;
begin
t := TfrMemoView(frReport1.FindObject('Memo1'));
if t <> nil then
t.Memo.Text := 'FastReport';
end;