How control file names (save, open)

edited April 2011 in FastReport 4.0
Hi
how can i control process of saving new fr3 file ie. i need to add prefix (rename) file after save, use editor open dialog with filter not for extension only

Is there a simplest way, than changing sources ?
Thanks

but in delphi
http://www.fast-report.com/en/forum/lofive....php/t6999.html

Comments

  • gpigpi
    edited 4:38AM
    Use for example
    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[3].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.
    
  • edited May 2011
    to simple [img]style_emoticons/<#EMO_DIR#>/laugh.gif" style="vertical-align:middle" emoid=":lol:" border="0" alt="laugh.gif" /> i try to use your code as inspiration to write something for control file names, but for templates editor (fr3 designer) unfortunately changing TfrxDesigner is not so easy for my Thanks for any tip / sample // edit[/img] http://www.fastreport.ru/en/forum/lofivers....php/t5855.html
    almost home

    // edit 2
    in Demos : ExternalDesigner

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.