Search code examples
delphidelphi-xe4fastreport

FastReports - programatically set text in a text object field


I am trying to pass the content of AdvOfficeStatusBar1.Panels[0] to a Memo 4 of the frxreport1. The AdvOfficeStatusBar1.Panels[0] is date type (psDate). So before I open the report I would like the Memo to display my statusbar date.


Solution

  • I found out this by myself :

    procedure TForm1.cxButton1Click(Sender: TObject);
    var
      Memo: TfrxMemoView;
      Component: TfrxComponent;
      begin
    Component := frxReport1.FindObject('Memo4');
      if Component is TfrxMemoView then
      begin
        Memo := Component as TfrxMemoView;
        Memo.Text := AdvOfficeStatusBar1.Panels[0].Text;
        frxReport1.ShowReport;
      end;
    end;