TFrxRichView Editor

edited 10:45PM in FastReport 3.0
Hello [img]style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> How can I enable in my application the TFrxRichView Editor. I'd like to give possibility at runtime to edit document before printing. I mostly need the buttons (Add Expression, Open File). I'm using Delphi 7 and Fast Report 3. Thanks in advance[/img][img]style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> MarcoL[/img]

Comments

  • gpigpi
    edited 10:45PM
    Try
    uses frxRich, frxRichEditor, frxDesgn;
    procedure TForm1.frxReport1ClickObject(Sender: TfrxView;
      Button: TMouseButton; Shift: TShiftState; var Modified: Boolean);
    begin
      if Sender is TfrxRichView then
        with TfrxRichEditorForm.Create(Form1) do
          begin
            RichView := TfrxRichView(Sender);
            Modified := ShowModal = mrOk;
            Free;
          end;
    end;
    
  • edited 10:45PM
    Hello

    Thanks a lot. It works.
    Now, I can edit, load and save text at runtime.

    But it still doesn't work a Add Expression button. I need it because user can't choose and add dataset fields to text. When I click this button in the Rich Editor Form I get a message ACCESS VIOLATION. If it's not a problem for you please help me.


    So far I put TFrxRichView inside TFrxMasterData, TFrxMasterData is connected with TFrxDBDataset by TFrxMasterData.Dataset and I put your code in frxReport1ClickObject()


    Greetings,

    Marcol
  • gpigpi
    edited 10:45PM
    Try
    frxReport1.DesignReportInPanel(Panel1);
         with TfrxRichEditorForm.Create(TfrxDesignerForm(frxReport1.Designer)) do
          begin
            RichView := TfrxRichView(frxReport1.FindObject('Rich1'));
            ShowModal;
            frxReport1.Designer.Close;
            Free;
          end;
    

Leave a Comment