给你个代码,你参考下:
在fastreport中的onbeforeprint中写:
var a:string;
begin
a:=xm.text;
if sender=frxreport1.FindObject('picture1') then
if fileexists(extractfilepath(application.exename)+'/image/'+a+'.jpg') then
tfrxpictureview(sender).Picture.LoadFromFile(extractfilepath(application.exename)+'/image/'+a+'.jpg')
else
tfrxpictureview(sender).Picture.LoadFromFile(extractfilepath(application.exename)+'/image/1.jpg')