Reputation: 3699
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.
Upvotes: 1
Views: 10401
Reputation: 413
In C# language you can use the following:
report2.RegisterData(dt, "DataTable1");
TextObject t1 = (TextObject)report2.FindObject("Text1");
t1.Text = "I love Kurdistan!";
Upvotes: 0
Reputation: 3699
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;
Upvotes: 4
Reputation: 486
You can set the text of a fastreport memo from code like this:
procedure SetMemo(aReport: TfrxReport; aMemoName: string; aText: string);
var
memo: TfrxMemoView;
begin
memo := aReport.FindObject(aMemoName) as TfrxMemoView;
if memo <> nil then
memo.Text := aText;
end;
Upvotes: 1