var
AGD: TfrPictureView;
begin
frReport1.LoadFromFile(ExtractFilePath(application.ExeName)+'report_cur_XX.frf');
AGD := TfrPictureView(frReport1.FindObject('PictureAGD'));
//加载A.GD图片
adotemp11:=tadoquery.Create(nil);
adotemp11.Connection:=dm.ADOConnection1;
adotemp11.Close;
adotemp11.sql.clear;
adotemp11.SQL.Text:='select A.Photo from chk_valu A,clinicchkitem B where A.itemid=B.itemid AND B.dlttype=''A.GD'' and A.pkunid='+ADObasic.fieldbyname('唯一编号').AsString;
adotemp11.Open;
MS:=TMemoryStream.Create;
TBlobField(adotemp11.fieldbyname('photo')).SaveToStream(MS);
MS.Position:=0;
tempjpeg:=TJPEGImage.Create;
tempjpeg.LoadFromStream(MS);
MS.Free;
if not adotemp11.fieldbyname('photo').IsNull then
AGD.Picture.assign(tempjpeg) else
AGD.Visible:=false;
tempjpeg.Free;
adotemp11.Free;
end;
注:1、PictureAGD是报表中图片组件的名称
2、图片是从数据库中获取的