Rich format to pure text, DBSRichViewEdit

General TRichView support forum. Please post your questions here
Post Reply
agent86
Posts: 59
Joined: Mon Jun 28, 2010 2:18 am
Location: San Francisco Bay Area, USA
Contact:

Rich format to pure text, DBSRichViewEdit

Post 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?
Sergey Tkachenko
Site Admin
Posts: 17566
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post 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;
agent86
Posts: 59
Joined: Mon Jun 28, 2010 2:18 am
Location: San Francisco Bay Area, USA
Contact:

Thank you! and a question...

Post 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?
Sergey Tkachenko
Site Admin
Posts: 17566
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post 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.
agent86
Posts: 59
Joined: Mon Jun 28, 2010 2:18 am
Location: San Francisco Bay Area, USA
Contact:

Keep Strikeout?

Post by agent86 »

Is there anyway to keep strikeout?
Sergey Tkachenko
Site Admin
Posts: 17566
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Keep where?
agent86
Posts: 59
Joined: Mon Jun 28, 2010 2:18 am
Location: San Francisco Bay Area, USA
Contact:

Do not lose sriekout when going to pure text

Post by agent86 »

Is ther a way to GetAllText and leave strikeout in place. When I tested it the strikeout disappears as well.
Sergey Tkachenko
Site Admin
Posts: 17566
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post 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.
Post Reply