Saved RichViewEdit Content Causes Endless Loop
Posted: Fri Aug 29, 2008 10:32 am
Hi.
I used the following code to insert the contents of a blob field from 2 records of a DBISAM query into a RichViewEdit and then store the content of the RichViewEdit back into another table.
When I use TppDBRichView in ReportBuilder 7 against the single BODY field in the table, the 2 combined blob fields are printed over and over again.
Am I missing a statement somewhere?
Thanks.
Frederick
I used the following code to insert the contents of a blob field from 2 records of a DBISAM query into a RichViewEdit and then store the content of the RichViewEdit back into another table.
Code: Select all
// oQry is a DBISAM query
// oTb is a DBISAM table
// rvGen is a TRichViewEdit
// rvSrc is a TDBRichViewEdit linked to oQry
oQry.first;
rvGen.Clear;
while ( not oQry.eof ) do begin
stream := TMemoryStream.Create;
try
rvSrc.SaveRTFToStream(stream, false);
stream.Position := 0;
rvGen.InsertRTFFromStreamEd(stream);
rvGen.InsertText(#13#10);
finally
stream.Free;
end;
oQry.next;
end;
rvGen.AddBreak;
rvGen.Format;
oTb.edit;
oTb.fieldbyname('body').Clear;
Stream2 := oTb.CreateBlobStream(oTb.fieldbyname('body'), bmWrite);
try
rvGen.SaveRTFToStream(Stream2, False);
finally
Stream2.Free;
end;
oTb.post;
Am I missing a statement somewhere?
Thanks.
Frederick