load picture

edited 10:49AM in FastReport 4.0
Hello,

I have a picture on the report, (not connected to a database), I would like to change the picture when I click a button The file name is variable, same image change each time when I click the button.
Also I pass the file name from my Delphi form to the report

Thanks in advance

Comments

  • gpigpi
    edited 10:49AM
    Use in Delphi:
    frxReport1.Variables.Variables['FileName'] := '''' + 'C:\test.bmp' + '''';
    
    in script:
    procedure Picture1OnPreviewClick(Sender: TfrxView; Button: TMouseButton; Shift: Integer; var Modified: Boolean);
    begin
         TfrxPictureView(Sender).Picture.LoadFromFile(<FileName>);
         Modified := True;                                             
    end;
    
    wrote:
    I would like to change the picture when I click a button The file name is variable, same image change each time when I click the button.
    Where you place this button?

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.