Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > DB-Aware

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 11-22-2007, 11:51 PM
davidj davidj is offline
Senior Member
 
Join Date: Jan 2001
Posts: 2,900
Default DBMemo showing RTF as Text Only?

I have a Blob field which contains RTF

I would like to have a DBMemo Field show this
Data as the text only, without the RTF tags

I have seen examples of loading lines etc with Memo
but I am using a DBMemo and would like to attach
it to the field and show as raw text only.

Can this be done?

Why? Because I want to put the data into a DBCtrlGrid

Thanks
Reply With Quote
  #2  
Old 11-22-2007, 11:59 PM
Norrit Norrit is offline
Moderator
 
Join Date: Aug 2001
Location: Landgraaf
Posts: 7,333
Default RE: DBMemo showing RTF as Text Only?

A TMemo cannot show RTF aswell, you need to use the TRichEdit.
For DB-aware controls it's the same, use the TDBRichEdit instead

Objective reality is a delirium caused by lack of alcohol in blood.
There is no place like 127.0.0.1
Reply With Quote
  #3  
Old 11-23-2007, 12:02 AM
davidj davidj is offline
Senior Member
 
Join Date: Jan 2001
Posts: 2,900
Default RE: DBMemo showing RTF as Text Only?

The problem is you can not use DBRichEdit inside a DBCtrlGrid
Reply With Quote
  #4  
Old 11-23-2007, 01:30 AM
Norrit Norrit is offline
Moderator
 
Join Date: Aug 2001
Location: Landgraaf
Posts: 7,333
Default RE: DBMemo showing RTF as Text Only?

Only way I can see is that you remove the RTF tags, but this will modify the content of the field. So this works for regular TMemo, but I don't think it'll work for TDBMemo.

Objective reality is a delirium caused by lack of alcohol in blood.
There is no place like 127.0.0.1
Reply With Quote
  #5  
Old 11-23-2007, 06:05 AM
mshkolnik mshkolnik is offline
Senior Member
 
Join Date: Jul 2001
Posts: 4,195
Default RE: DBMemo showing RTF as Text Only?

Do you need to view the memo only? Without edit/append?

If yes, then you may use the OnGetText event for this blob field and convert the rtf-string into plain text

With best regards, Mike Shkolnik
http://www.scalabium.com
Reply With Quote
  #6  
Old 11-23-2007, 10:03 PM
davidj davidj is offline
Senior Member
 
Join Date: Jan 2001
Posts: 2,900
Default RE: DBMemo showing RTF as Text Only?

Thanks Mike, how do I convert the RTF to text?
Reply With Quote
  #7  
Old 11-24-2007, 04:15 AM
davidj davidj is offline
Senior Member
 
Join Date: Jan 2001
Posts: 2,900
Default RE: DBMemo showing RTF as Text Only?

Hi Mike,

I just put a simple showmessage into the OnGetText
and it doesnt show?
Reply With Quote
  #8  
Old 11-25-2007, 04:05 AM
mshkolnik mshkolnik is offline
Senior Member
 
Join Date: Jul 2001
Posts: 4,195
Default RE: DBMemo showing RTF as Text Only?

1. create TRichEdit
2. load from your BLOB stream (field)
3. read PlainText property
4. destroy richedit

With best regards, Mike Shkolnik
http://www.scalabium.com
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:19 AM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.