Creating fastreport event via code Delphi

edited 7:40PM 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 7:40PM
    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 7:40PM
    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