delphi - Append formated text from SQL to TRichEdit -
can problem? how append formatted txt database field trichedit ?
just clarify: need contents of 2 database fields have formatted text (rtf) , put them in trichedit preserving formatting. use mssql express , field set text in ansi format.
ok works nice:
  tmp := tblcases.fieldbyname('field1').asstring;   str := tblcases.fieldbyname('field2').asstring;   delete (tmp,lastdelimiter ('}',tmp),1);   delete (str,1,1);   ms := tstringstream.create (tmp+ ansistring (#13#10)+str);   ms.position :=0;   dbdx.lines.loadfromstream(ms);   ms.free;      
to merge 2 rtf fields removed last closing } of first , first bracket of second creating 1 string. use tstringstream paste in trichedit. see updated code above.
Comments
Post a Comment