L
louchanghong
Unregistered / Unconfirmed
GUEST, unregistred user!
fastreport的打印方案以流的方式向表中保存时提示:“操作数类型冲突:text与image不兼容”
procedure Tfrm_fr_design_save.frDesignerSaveReport(Report: TfrReport;
var ReportName: String;
SaveAs: Boolean;
var Saved: Boolean);
var
tempStream : TMemoryStream;
fangan: TBlobField;
begin
tempStream:=TMemoryStream.Create;
tempStream.Clear;
Report.SaveToStream(tempStream);
fanganid:=trim(LEdit_fanganid.Text);
fanganname:=trim(LEdit_fanganname.Text);
fangandes:=trim(LEdit_fangandes.Text);
fangancate:=trim(LEdit_fangancate.Text);
moditime:=vartostr(now);
DM_main.server_connect(rdset_FrSav);
rdset_FrSav.Remoteclose;
rdset_FrSav.RTSQL.Clear;
if (fr_save_lx='open') then
begin
//修改报表
try
with rdset_FrSavdo
begin
RTSQL.Text:='update sys_rpt set fangan=:fangan '+
'where fanganid=:fanganid and dataid=:dataid ';
RTParams.ParamByName('fangan').LoadFromStream(tempStream,ftBlob);
RTParams.ParamByName('fanganid').AsString:=fanganid;
RTParams.ParamByName('dataid').AsString:='DJRPT_'+vartostr(djlxbs);
end;
finally
tempStream.Free;
end;
end ;
procedure Tfrm_fr_design_save.frDesignerSaveReport(Report: TfrReport;
var ReportName: String;
SaveAs: Boolean;
var Saved: Boolean);
var
tempStream : TMemoryStream;
fangan: TBlobField;
begin
tempStream:=TMemoryStream.Create;
tempStream.Clear;
Report.SaveToStream(tempStream);
fanganid:=trim(LEdit_fanganid.Text);
fanganname:=trim(LEdit_fanganname.Text);
fangandes:=trim(LEdit_fangandes.Text);
fangancate:=trim(LEdit_fangancate.Text);
moditime:=vartostr(now);
DM_main.server_connect(rdset_FrSav);
rdset_FrSav.Remoteclose;
rdset_FrSav.RTSQL.Clear;
if (fr_save_lx='open') then
begin
//修改报表
try
with rdset_FrSavdo
begin
RTSQL.Text:='update sys_rpt set fangan=:fangan '+
'where fanganid=:fanganid and dataid=:dataid ';
RTParams.ParamByName('fangan').LoadFromStream(tempStream,ftBlob);
RTParams.ParamByName('fanganid').AsString:=fanganid;
RTParams.ParamByName('dataid').AsString:='DJRPT_'+vartostr(djlxbs);
end;
finally
tempStream.Free;
end;
end ;