How to load rtf file to richview

Hi

How do I load a rtf file into a richview object at runtime?

I'm using fr 2.47 and delphi 7


Thanks


Ken

Comments

  • edited 2:10PM
    I have used the following procedure:

    1. Put a parameter in your RichTextObject on your report, for instance [MyRtf]
    2. Create a TstringList
    2. Put your rtf-file in the TStringList
    3. Add an OngetValue procedure to your frReport


    Some code:

    procedure frReport1.OnGetValue( const ParName: string;
    var ParValue: Variant );
    begin
    if ParName = 'MyRtf' then begin
    Strings1 := TStringList.Create;
    Strings1.LoadFromFile('MyRtfFile');
    ParValue := Strings1.Text;
    end;
    end;

    In stead of LoadFromFile you can use other methods to fill the Strings1 with your rtf-lines.
    Well, I Hope I haven't forgotten something, but you'll grasp the idea.

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.