Page 1 of 1

Rich format to pure text, DBSRichViewEdit

Posted: Tue Jun 29, 2010 11:59 pm
by agent86
I have 2 MS SQL 2000 datafields,

Finding_Text and
Finding_RichView

I have a dbmemo linked to Finding_Text.
I have a DBSRichViewEdit linked to Finding_RichView

Editing will be done in the DBSRichViewEdit.

When the data is saved in DBSRichViewEdit I want a pure text version saved in Finding_Text.

What to do?

Posted: Wed Jun 30, 2010 2:27 pm
by Sergey Tkachenko
If you use a table component inherited from TDataSet, you can use BeforePost event:

uses RVGetText; (or RVGetTextW if you use Unicode text)

procedure TForm1.Table1BeforePost(DataSet: TDataSet);
begin
Table1.FieldByName('Finding_Text').AsString := GetAllText(DBSRichViewEdit1.RichViewEdit);
end;

Thank you! and a question...

Posted: Wed Jun 30, 2010 2:53 pm
by agent86
Thank you for the quick reply.

Do you know if there are any samples the use the DBSRichViewEdit? I couldn't find any.

Does it essentially work the same way as the SRichViewEdit so that the examples work for both DBSRichViewEdit and SRichViewEdit?

Posted: Wed Jun 30, 2010 3:10 pm
by Sergey Tkachenko
Yes, DBSRichViewEdit works like SRichViewEdit.
You can use RichViewActions for it as well. But do not use New-Open-Save-SaveAs actions, they are related to files.

Keep Strikeout?

Posted: Tue Jul 06, 2010 12:32 am
by agent86
Is there anyway to keep strikeout?

Posted: Tue Jul 06, 2010 7:45 pm
by Sergey Tkachenko
Keep where?

Do not lose sriekout when going to pure text

Posted: Tue Jul 06, 2010 8:11 pm
by agent86
Is ther a way to GetAllText and leave strikeout in place. When I tested it the strikeout disappears as well.

Posted: Wed Jul 07, 2010 3:13 pm
by Sergey Tkachenko
But strikeout (if you mean fsStrikeOut in Style) cannot be stored as text.
You need to get data in RTF or RVF format instead.