Problems with frRichview

This example I have extract from the F.A.Q:
First I have placed on the fastreport-form a tfrrichview-Component with the name:
Rich1. Then I have written this progammcode in the beforeprint-Event.

procedure TForm1.frReport1BeforePrint(pMemo: TStringList; View: TfrView);
begin
if view.name = 'Rich1' then
tfrrichview(view).Memo.LoadFromFile('test.rtf');

end;

what's wrong?
The example in the forum with getvalue-procedure do not work also.
Where ist my error? ;)

Comments

  • edited 7:34PM
    Hi!

    Try this code. I think your code didn't work because of the TFRView's (and of course the descendants') Memo property holds the code that runs before rendering the specific object's content to the appropriate metafile's canvas on the report level. (and written in the FR script language)

    procedure TForm1.RBeforePrint(Memo: TStringList; View: TfrView);
    Var Rich:TFRRichView;
    begin
    If View.Name='Rich1' then
    Begin
    TFRRichView(View).RichEdit.Lines.LoadFromFile('mastapp.rtf');
    End;
    end;

    This works well for me.

    Regards:Alex

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.