Override Save button

edited 11:40AM in FastReport 4.0
I want to call my own Save Dialog instead of default save dialog on preview screen. Can anyone show me how to do that in Delphi? Thanks. I'm using Basic Fastreports.

Comments

  • gpigpi
    edited 11:40AM
    For "Open" button:
    Следующий обработчик переопределяет обработчик кнопки "Открыть"
    uses frxClass, frxPreview, frxPreviewPages, frxRes;
    
    type
     TForm1 = class(TForm)
       frxReport1: TfrxReport;
       procedure frxReport1Preview(Sender: TObject);
       procedure NewOnClick(Sender: TObject);
     end;
    
    var
     Form1: TForm1;
    
    
    implementation
    
    {$R *.dfm}
    
    procedure TForm1.frxReport1Preview(Sender: TObject);
    begin
     if frxReport1.PreviewForm is TfrxPreviewForm then
        begin
         TfrxPreviewForm(frxReport1.PreviewForm).OpenB.OnClick := NewOnClick;
         TfrxPreviewForm(frxReport1.PreviewForm).RightMenu.Items[4].OnClick := NewOnClick;
        end;
    end;
    
    procedure TForm1.NewOnClick(Sender: TObject);
     var
     OpenDlg: TOpenDialog;
    begin
     if frxReport1.Engine.Running then Exit;
     OpenDlg := TOpenDialog.Create(nil);
     try
       OpenDlg.Options := [ofHideReadOnly];
       OpenDlg.Filter := frxResources.Get('clFP3files') + ' (*.fp3)|*.fp3';
       if OpenDlg.Execute then
       begin
         TfrxPreview(frxReport1.Preview).LoadFromFile(OpenDlg.FileName);
         frxReport1.PreviewForm.Caption := OpenDlg.FileName;
       end;
     finally
       OpenDlg.Free;
     end;
    end;
    
    end.
    
    For Save button code is a same

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.