Creating fastreport event via code Delphi

edited 11:20AM in FastReport 4.0
//no codigo Delphi [in Delphi Code]
frxReport.LoadFromFile('reportfolder\test.fr3');
with frxReport do begin
frxreport.ScriptText.Clear; //limpo o texto do script [clear script text]
frxreport.ScriptText.Add('procedure MasterDataOnBeforePrint(Sender: TfrxComponent);');
frxreport.ScriptText.Add('Begin');
frxreport.ScriptText.Add('Memotest.Color := $00FF0000;');
frxreport.ScriptText.Add('end;');
frxreport.ScriptText.Add('Begin');
frxreport.ScriptText.Add('end.');
frxreport.ScriptText.Add('masterData.OnbeforePrint :='+''''+'MasterDataOnBeforePrint'+''''+';');
frxReport.ShowReport;
end;

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 11:20AM
    you are posting in the wrong forum please post in the forum of the product you are using.
    and what is your question.
  • gpigpi
    edited 11:20AM
    Try
    frxReport.LoadFromFile('reportfolder\test.fr3');
    with frxReport do begin
    frxreport.ScriptText.Clear; //limpo o texto do script [clear script text]
    frxreport.ScriptText.Add('procedure MasterDataOnBeforePrint(Sender: TfrxComponent);');
    frxreport.ScriptText.Add('Begin');
    frxreport.ScriptText.Add('Memotest.Color := $00FF0000;');
    frxreport.ScriptText.Add('end;');
    frxreport.ScriptText.Add('Begin');
    frxreport.ScriptText.Add('masterData.OnbeforePrint :='+''''+'MasterDataOnBeforePrint'+''''+';');
    frxreport.ScriptText.Add('end.');
    frxReport.ShowReport;
    end;
    

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.