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 7:33PM
    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