質問

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.

役に立ちましたか?

解決

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;

他のヒント

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;

In C# language you can use the following:

report2.RegisterData(dt, "DataTable1");
TextObject t1 = (TextObject)report2.FindObject("Text1");
t1.Text = "I love Kurdistan!";
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top