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 2:13AM
    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 2:13AM
    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 2:13AM
    Try TMemoryStream.
  • edited 2:13AM
    Rich.RichEdit.Lines.LoadFromStream(sStream);

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.