How to load a rtf String into TfrxRichView component

I use PascalScript in my report and from reading the documentation https://www.fast-report.com/documentation/UserManFrNET-en/index.html?richobject.htm i assumed i could just do

Rich1.text := 'My text';

Which does not work.

After lots of googling, the only thing i found was a forum post showing how to load from file:

Rich1.RichEdit.Lines.LoadFromFile('rtf.rtf');

From that, i tried some guesses like

Rich1.RichEdit.Lines.LoadFromString('asd');

But without success. What i conclude is that i would like to see the full definition of the TfrxRichView component with all it's properties and methods.


My end-goal is to display some html that is in my DB. As FR can only do some inline HTML, i want to convert it via code to rtf and output that conversion result. This is the only way i see. Any better ideas?

Comments

  • By accident, i found this to work:

    procedure Rich1OnBeforePrint(Sender: TfrxComponent);

    begin

     Rich1.RichEdit.lines.Text := '{\rtf1\ansi{\colortbl;\red0\green0\blue255;}{\pard {\bBlah} {{{weet}}} {\field{\*\fldinst{HYPERLINK "good.html"}}{\fldrslt{\ul\cf1cool}}}\par}}';

    end;

    Now, i would still like to know why that is, as i only found references like  Rich1.RichEdit.Text

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.