1 (edited by jrga 2023-11-09 00:37:00)

Topic: memo field conversion to RTF

I have a table with 4 thousand records filled with culinary recipes, which are in a memo field. I copied the memo field to another field, for editing with RTF control, but the text was left without a line break. I would like to maintain the same paragraph structure in the RTF as the text field. Can anyone help?

Post's attachments

Attachment icon img.jpg 221.22 kb, 14 downloads since 2023-11-09 

Roberto Alencar

Re: memo field conversion to RTF

There is a RTF memo component, the one with a little red A.

Re: memo field conversion to RTF

tcoton wrote:

There is a RTF memo component, the one with a little red A.

I didn't understand! I have MVD 5.6

Roberto Alencar

4 (edited by sparrow 2023-11-09 10:23:40)

Re: memo field conversion to RTF

jrga wrote:

I have a table with 4 thousand records filled with culinary recipes, which are in a memo field. I copied the memo field to another field, for editing with RTF control, but the text was left without a line break. I would like to maintain the same paragraph structure in the RTF as the text field. Can anyone help?

Hi,
As an option, store text in RTF format in the database.
This will allow you to save formatting, fonts... and save pictures. Of course, small icons are better.


Example below

OR

use script to load (form2.RichEdit1.Text ) into RichEdit

  form2.RichEdit1.Text := SQLExecute('select txt FROM dd where id=2'); 

P.S.  But the first time you save the text, it will be saved in the database in RTF format.

Post's attachments

Attachment icon RichEdit.zip 9.55 kb, 45 downloads since 2023-11-09 

5 (edited by jrga 2023-11-09 13:54:32)

Re: memo field conversion to RTF

Hi Sparrow, I will explain my problem better: I want to have the same text as the cooking recipe in two fields. A simple text field and a field that will be edited with RTF control. This way I can do research on the ingredients of a recipe in simple text fields. Derek helped me develop this idea. The Formatted Fields with RTF do not allow research with "Select ... Where". For this, in addition to the recipe field, I created the field r_e_c_e_i_t_a_rtf. Then I transferred the entire content from the first to the second field through SQLSTUDIO. But when I edit the field r_e_c_e_i_t_a_rtf, the text is all disorganized, according to the photo I sent for this topic. Since there are 4,000 records, making any adjustment manually is unfeasible. Sorry for the long text.

Roberto Alencar

Re: memo field conversion to RTF

By default, RichEdit loads text as RTF.
If RichEdit does not find RTF markup, then the text is displayed on one line.

Look at this solution. Allows you to read and load TXT or RTF text into RichEdit.
Parses the text header and downloads as Text or TextRTF.

Post's attachments

Attachment icon RichEdit-mod.zip 11.74 kb, 51 downloads since 2023-11-09 

Re: memo field conversion to RTF

sparrow wrote:

By default, RichEdit loads text as RTF.
If RichEdit does not find RTF markup, then the text is displayed on one line.

Look at this solution. Allows you to read and load TXT or RTF text into RichEdit.
Parses the text header and downloads as Text or TextRTF.


Hi Sparrow, it worked perfectly. Thank you very much!

Roberto Alencar