Printing a RichEdit-Field

Hi,

I would like to print a RichEdit-Field including formatted text. How can I do that with FastReport? Is there an example on how to do this?

Tiger

Comments

  • Just add RichText object in FR Designer.
    Don't forgot to put frxRichObject into your form.
  • edited 6:42AM
    Thanks for your help. But what do I have to do to get the text from the RichEdit field of my application to the FastReport sheet?
  • edited 6:42AM
    I have tried this in the OnBeforePrint event, but there is an error message 'invalid file format' when the report is shown:
    procedure TForm41.frxReport1BeforePrint(Sender: TfrxReportComponent);
    var
      s: TStringStream;
      Rich: TfrxRichView;
      i, j: Integer;
    begin
      if Sender is TfrxRichView then begin
        Rich := TfrxRichView(Sender);
        s := TStringStream.Create('');
        RichEdit1.Lines.SaveToStream(s);
        s.position:=0;
        Rich.LoadFromStream(s);
      end;
    end;
    

    can anyone help?

    Tiger
  • edited 6:42AM
    Try TMemoryStream.
  • edited 6:42AM
    Rich.RichEdit.Lines.LoadFromStream(sStream);

Leave a Comment