fastreport保存到数据库问题?
var
template:TStream;
--加入数据库
template:=TMemoryStream.Create;
template.Position:=0;
if OpenDialog1.Execute then OpenDialog1.Files.SaveToStream(template);
DM.frxReport1.SaveToStream(template);
DM.RptData.Append;
try
DM.RptData.Edit;
DM.RptData.FieldByName('id').AsString:=Trim(DM.Report.FieldByName('id').AsString);
DM.RptData.FieldByName('report').AsString:=ExtractFileName(OpenDialog1.FileName);
(DM.RptData.FieldByName('rptmemo') as TBlobField).LoadFromStream(template);
DM.RptData.Post;
finally
template.Free;
end;
DM.RptData.Close;
DM.RptData.Open;
--读取报表
try
template:=DM.RptData.CreateBlobStream(DM.RptData.FieldByName('rptmemo'),bmRead);
template.Position:=0;
DM.frxReport1.LoadFromStream(template);
DM.frxReport1.FileName :=Trim(DM.RptData.FieldByName('Report').AsString);
DM.frxReport1.DesignReport;
finally
template.Free;
end;
问题:读出来的报表并不是加入的的报表,还是加入的报表本来就有问题,如:加入的1.fr3,2.fr3等报表,读出来的都是10.fr3报表,可并没加入10.fr3这张报表,不是为什么?