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 11:25AM
    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