Hi,
I'm a new user and I have problem with loading RTF from the database:
for example before saving I have:
1. aaaaa
but after the loading I have:
aaaaa
also this bolded text is in a different color than it should be.
On my form I have:
//save to db
var
oStream : TStringStream;
sText : string;
begin
oStream := TStringStream.Create('');
try
if RichViewEdit.SaveRTFToStream(oStream, False) then begin
oStream.Seek(0, soFromBeginning);
sText := oStream.ReadString(oStream.Size);
sql.FieldByName('rtftext').AsString := sText;
end;
finally
oStream.Free;
end;
end;
// load from db:
RichViewEdit.Clear;
if not sql.FieldByName('rtftext').IsNull then begin
oStream := TStringStream.Create(sql.FieldByName('rtftext').AsString);
try
oStream.Position := 0;
RichViewEdit.LoadRTFFromStream(oStream);
RichViewEdit.Format;
finally
FreeAndNil(oStream);
end;
end;
What i'm doing wrong? Have you got any ideas?
Thank you in advance