Loading external file

DO you know if, in the report, the syntax :

RichTitre1.loadFromFile('Titre1.rtf') (where RichTitre1 is a tfrRichView)
is allowed ?

I have the solution to load the file in the code (Delphi) but it seems to be inefficient in the report script.

TU

Comments

  • edited May 2004
    I'm also interested on this code
    Did u get the solution Philnext?

    The difference is that I'd need to load also the Richedit content from a BLOB field in a database...

    Does 1 know how to do this? To load the content of the richedit to the frrichview in the report? thanks ;)
  • edited 12:00AM
    no, no solution today for loading the *.rtf in teh report.
    Do you need the solution for loading in the Delphi code ?
  • edited 12:00AM
    It seems I got the solution trying recently...
    put the TfrRxRichObject in your project.
    Then, put the richview object in your report.

    Then, select that object.. and go to the report's inspector object... then u can assign a database field to the richview object.

    It loads perfectly the richview data from the blob file.

    The only thin we gotta learn now is how to load the contents from the rtf file located in the disk... but i think that the richview object must have the function include in its own code...

    try accessing the functions and props. of the report's richview object and I'm sure you'll find something...

    if i find something, i'll post a reply
    cya

    i solved only to load from blob field... ;)
  • gordkgordk St.Catherines On. Canada.
    edited 12:00AM
    try using the lines property of either of the rich objects memos
    regards ;)
  • edited 12:00AM
    Dear all,
    The reply for the blob is clear.
    For information I post the solution (yet in the forum I know !) for loading the *.rtf in the code :
    procedure TFMReport.frReport1BeforePrint(Memo: TStringList; View: TfrView);
    begin
    If View.Name='RichTitre1' then
      if FileExists('.\reports\titre1.rtf') then
        TFRRichView(View).RichEdit.Lines.LoadFromFile('.\reports\titre1.rtf');
    end;
    
    But ... I don't know if it is possible IN the report...(it was my question !)
  • gordkgordk St.Catherines On. Canada.
    edited 12:00AM
    do it in the script section of the rtf objects memo.
    but you won't be able to test file existence unless you use a get val function for a variable or write an onuserfuntion and return a test value.
    regards
    gord ;)
  • edited 12:00AM
    It's OK thank you !
  • edited June 2004
    ;) It's not working for me...
    I wrote this code in the rtf object memo
    Rich1.Lines.LoadFromFile('DE000096.rtf');
    
    and nothing happens.... can anyone tell me what's wrong ?
    thanks

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.